Chapter    8

Managing What Happens When

So far in this book, you’ve made things happen in a fairly regular manner. You send a message to an object, the method corresponding to that message selector runs and then returns, and your code continues. This only scratches the surface of what’s possible with Objective-C and Cocoa Touch; you can run code later, run two pieces of code at the same time, or run nothing at all until something else happens. In this chapter, we’ll discuss the specifics of how you manage when your code runs, as well as delving into why it matters. We’ll cover writing code to take advantage of the latest multicore processors, using timers to repeat the execution of code over time, and run loops, Apple’s efficient way to wait ...

Get Learn Cocoa Touch for iOS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.