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:.


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:.

