How to properly quit application, call exit(0)?

application-shutdown, cocoa

Solution

Use `NSApplication`'s `terminate` method. For example:

[NSApp terminate:self]

Documentation is available here.

Problem

I'm not sure which is the right way, right now I'm just calling `exit(0)` when a user clicks on the exit button.

Original source