I learned iOS programming thanks to Stanford's CS193p course (on iTunes U) as well as the iOS programming book from Big Nerd Ranch. In both of those, they recommend using dispatch_async()
, dispatch_get_main_queue()
, etc. to handle threading and concurrent operations. However, at WWDC 2012's session on building concurrent UI, the speaker recommended the use of NSOperationQueue
.
What are the differences between dispatch_*()
and NSOperationQueue
, and is there any reason (technical, performance, stylistic, or otherwise) that I should use one over the other? Is NSOperationQueue
just an Objective-C wrapper around dispatch_async
, or is there more to it than that?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…