Man of One Way Man of One Way - 1 year ago 123
Objective-C Question

How do I quit a mac application programmatically?

I need to add a quit-button to my application that runs from the menubar in mac.
How do I programmatically quit an application in mac?

Answer Source

There is a simpler form to quit from code:

[NSApp terminate:self];

But as you're adding a button, all you have to do is to control drag from your button to the Application icon and connect the method terminate:.

enter image description here enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download