views:

665

answers:

2

Is it possible to make simultaneously two requests in parallel to the same server using NSURLConnection?

I'm trying to do it, and it looks like the second request do not start until the first one finishes.

+1  A: 

You need to create two NSURLConnection objects.

leonho
+2  A: 

If you use the sync version of NSURLConnection

+ (NSData *)sendSynchronousRequest:(NSURLRequest *)request returningResponse:(NSURLResponse **)response error:(NSError **)error

you need to start two threads to get the behavior you want, you can do this my moving the download in a own method and call this over:

- (void)performSelectorInBackground:(SEL)aSelector withObject:(id)arg

The other way would be to use Asynchronously version of NSURLConnection, see docu.

catlan