First, I think iPad has only single NIC (or what ever hardware) for handling connection. So requests are queued and serviced sequentially and there can't be 2 connections running at the same time. Is this guess true?
I have UITabBar
controller, where each tab's view controller download & parses a different JSON feed URL.
I have created a singleton class that downloads feeds from single URL, then parses it and calls a delegate function of one of the view controllers when work is done.
I have decided to use asynchronous connection in order not to hang the main thread.
URLConnection4Target * _conn = [[URLConnection4Target alloc] initWithRequest:request delegate:self startImmediately:NO];
So tabs are all accessible from the same window (not navigated one after another), and they use different URLs for different feeds.
My problem is how to design the connection in the singleton class to serve that multiple view controllers sequentially (or concurrently if possible).
I tried to use NSInvocationOperation
because i was not sure what will happen if the user clicked on a one tab and accesses the NSURLConnection
object while it's already accessible by different view controller.