I am executing NSURLSession requests to fetch JSON objects from a cloud service, most of these are calls are synch and have no dependencies but in one instance I have a dependency to take into account, I have to ensure that 2 NSURLSessions are performed in order and that the first one is finished before the second one starts so I created a queue as follows
jsonQ = dispatch_queue_create("com.jongel.jsonQ", NULL);
And then I dispatch my jobs like this
dispatch_async(jsonQ, ^{
[helperFunctions synchOh];
[helperfunctions synchOrp];
});
Will doing it this way wait for the synchOh NSURLSession asynch call to return before it launches the synchOrp or will it dispatch the synchOrp call as soon as the synchOh call is dispatched?
Does it matter if I change the dispatch_asynch to dispatch_synch?