Search code examples
cocoaapplication-shutdown

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


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.


Solution

  • Use NSApplication's terminate method. For example:

    [NSApp terminate:self]
    

    Documentation is available here.