In my view controller I have two UIScrollViews. One is to display latest news updates from server and other is to display some images from the server. So I have to parse two json feeds for these data. I am using ASIHTTPRequest for the network services.
So in my -viewWillAppear: method I’m calling two separate asynchronous instances of ASIHTTPRequest
-(void)viewWillAppear{
call news JSON and parse
call image JSOn and parse
process news Data and display the data in UI
process image Data and display
}
So which is better here to use a ASIQueue or two different instances of ASIHTTPRequest?
It seems all programmatic from your pseudocode for
viewWillAppear:. So I’d say use anASINetworkQueueand set the completion handlers of the requests to a function which will action the appropriate display calls:Or, instead of using methods, you can write the parse and processing code in a code block and set
completionBlockon the ASIHTTPRequests.