0

I am trying to send multiple NSUrlConnection simultaneously using thread concept. Also i am trying to handle the connection delegates.

I tried sending repeated request but i dono how to handle the received data. Is there any documentation regarding this multiple NSURLConnection.

Sasi
  • 1,666
  • 2
  • 24
  • 44

1 Answers1

1

Use sendAsynchronousRequest:queue:completionHandler: to send a request in the background and use to completion handler to react on the completed handler. This will allow you to send as much requests as you want at the same time.

For a documentation about NSURLConnection have a look at the official Apple Class Reference and Samples.

I would also recommend you do have a look at ASIHTTPRequest or MKNetworkKit. Both are libraries supporting you to create HTTP requests, but with a lot of useful additions and a little bit easier to use.

miho
  • 11,765
  • 7
  • 42
  • 85
  • I just went through the Apple Class Reference and Samples. Now i am having an overview about Background connections. But to understand better if i get any sample it will be helpful.Can you point me to some simple sample for multiple NSURLConnection at same time. – Sasi Sep 09 '12 at 06:22
  • Have a look at the top answer in this Stackoverflow question. There is a very simple example of sendAsynchroniusRequest: http://stackoverflow.com/questions/9270447/how-to-use-sendasynchronousrequestqueuecompletionhandler – miho Sep 09 '12 at 11:29