6. Blocks and Grand Central Dispatch

Multithreaded programming is something that every developer is going to need to think about with modern application development. Even if you don’t think that your application is multithreaded, it most probably is because system frameworks often use extra threads to get work done off the UI thread. There’s nothing worse than an application that hangs because the UI thread is blocked. In Mac OS X, this results in the dreaded spinning beach ball; in iOS, your application may be terminated if it blocks for too long.

Fortunately, Apple has thought about multithreading in a whole new way. The core features of modern multithreading are blocks and Grand Central Dispatch (GCD). Although distinct and separate technologies, ...

Get Effective Objective-C 2.0: 52 Specific Ways to Improve Your iOS and OS X Programs now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.