I have been using NSURLConnection's sendAsynchronousRequest:queue:completionHandler: method which is great. But, I now need to make multiple requests in a row.
How can I do this while still using this great asychronous method?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s lots of ways you can do this depending on the behavior you want.
You can send a bunch of asynchronous requests at once, track the number of requests that have been completed, and do something once they’re all done:
You could chain the blocks together:
Or you could do all the requests synchronously in an ansynchronous block:
P.S. If you use any of these you should add some error checking.