For the More Curious: NSRunLoop

NSRunLoop is an object that waits. It waits for events to arrive and then forwards them to NSApplication. It waits for timer events to arrive and then forwards them to NSTimer. You can even attach a network socket to the run loop, and it will wait for data to arrive on that socket.

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide 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.