I am developing a mac application in Xcode 5.1. I would like to terminate the application when the close button is clicked inside the application. Check the link for the image.
The link is as follows http://tinypic.com/r/2yn070h/8.
There is a red button on top of the window. When I click the red button the application has to be terminated. The code for termination is as follows
[NSApp terminate:self];