I am doing a lot of GCD and asynchronous rendering and data retrieval work lately and I really need to nail the mental model about how asynchronous is done.
I want to focus on setNeedsDisplay
and the NSURLConnectionDelegate
suite of methods.
- Is it correct to call setNeedsDisplay asynchronous? I often call it via
dispatch_async(dispatch_get_main_queue(), ^{})
which confuses me. - The
NSURLConnectionDelegate
callbacks are described as asynchronous but are they not actually concurrently run on the main thread/runloop. I am a but fuzzy on the distinction here.
More generally in the modern iOS era of GCD what is the best practice for making GCD and these methods play nice together. I'm just looking for general guidelines here since I use them regularly and am just trying not to get myself in trouble.
Cheers,
Doug