Creating multiple NSURLConnections. How to identify which Async call

后端 未结 5 1777
借酒劲吻你
借酒劲吻你 2021-02-06 02:05

I am intending to create 2 requests using NSURLConnection. When the server responds and calls connectionDidFinishLoading it passes in the connection as the parameter, but how d

5条回答
  •  眼角桃花
    2021-02-06 02:24

    What I do in my projects is create a wrapper class for the connection. This way, you can keep a new instance for each connection you need, and maintain these classes in another manager class.

    Something like [AsynchronousConnection initWithURL:delegate:selector:]

    Then you can be ensure the right thing is called when the NSURLConnection is done/failed.

提交回复
热议问题