Next: 2 Setting your application's Up: 1 The shared application Previous: 1.3 The run loop

1.4 Terminating your application

Whenever you want to terminate your application, you can do:
[NSApp terminate: nil];
This is usually done when the user selects the Quit entry in the main menu. When you terminate your application, the gui library quits the run loop and exits the program.

Btw, the argument of terminate: is of no importance, so we can pass any argument (nil in this case); the only reason why this method takes an object as argument is that it can then be set as the action of a gui control (discussed below).