Using GCD in iOS
So, I was looking at some WWDC session videos again and the speaker told that if you aren开发者_如何学运维't using GCD already it's time to. So I was googling some tutorial specially for iOS and didn't find any good one. By the way is there any difference with mac GCD and iOS version? So could someone point me to good guide.
Thanks in advance!
There is no difference, the Mac OS X and iOS version both use exactly the same library.
(made comment into answer)
The WWDC 2011 and 2010 videos are good, as are the Stanford University videos on iTunesU.
Generally you would want to use GCD to dispatch background tasks that would block the main UI thread.
An example would be the background downloading of images across a network. You wouldn't want the UI to hang whilst doing this, so creating a Block that downloads the image and dispatching it into a GCD queue works well as you don't need to worry about the lower level thread handling.
精彩评论