Next: 1.4 Terminating your application Up: 1 The shared application Previous: 1.2 Setting a delegate

1.3 The run loop of your application

When you call NSApplicationMain (), the GUI library ``runs'' your application. When the application is running, the GUI library simply enters a loop waiting for events from the user (such as the user clicking on a window, on a menu, or on the application icon). It creates an autorelease pool at the beginning of each loop, and empties it at the end; this means you don't have to worry about manually creating and emptying autorelease pools in your gui application once it is running.

Of course, if you run an application without having created any windows or menus, the application will wait indefinitely since the user has no means of communicating with it.



2008-01-16