So the task is the following: 1)I have a track ID, I need to ask the server for all the track data 2)parse response (here I also have an album ID) 3)now I have an album ID, I need to ask the server for all the album data 4)parse response (here I also have an artist ID) 5)now I have an artist ID, I need to ask the server for all the artist data
I wonder what is the right way to do this with gcd. 3 dispatch_sync-s inside dispatch_async? I want all this to be one operation, run in the background, so at first I thought about NSOperation, but all callbacks, parsing, saving to core data need to happen on background thread, so I'd have to create a separate run loop for callbacks to make sure it will not be killed before I get a response and will not block ui.
so the question is how should I use gcd here, or is it better to go with nsoperation and a runloop thread for callbacks? thanks