Binding Button action to close an App

Discussion in 'Mac Programming' started by harihb, Feb 22, 2011.

  1. harihb, Feb 22, 2011
    Last edited: Feb 22, 2011

    harihb macrumors newbie

    Joined:
    Jan 24, 2011
    #1
    I'm very much new to the world of cocoa, and I'm trying out small programs to get the hang of the mvc concept. Right now, I'm trying to close an app when I click a button on my app. Like having an 'Exit' button on your app.

    In my controller.h, I have created this

    Code:
    - (IBAction) exitApp : (NSButton*) sender;
    In my controller.m,

    Code:
    - (IBAction) exitApp : (NSButton*) sender {
    
    // what should I write inside to close an app on click of a button ?
    
    }
    Can someone please help? :)
     
  2. bux macrumors regular

    Joined:
    Apr 22, 2004
    Location:
    Sweden

Share This Page