• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Exit an Application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exit an Application


  • Subject: Re: Exit an Application
  • From: Ken Thomases <email@hidden>
  • Date: Tue, 14 Apr 2009 13:48:12 -0500


On Apr 13, 2009, at 9:18 AM, Luca C. wrote:

2009/4/13 Luca Ciciriello <email@hidden>

I've created an application with a button "Exit" and I've connected it with
the method:


- (IBAction)exitApp:(id)sender
{
      // TODO
}

Now my question is: "Which call I have to do to quit my application instead
of // TODO?"
Is there a NSsomething to call?


[[NSApplication sharedApplication] terminate:self];

Also, in this simple case, the button can directly target the application object with the terminate: action. That is, the above - exitApp: method is an action method. So is -[NSApplication terminate:]. It is an action method for the very purpose of being connected to UI elements via the target-action mechanism.


Cheers,
Ken

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Exit an Application (From: Luca Ciciriello <email@hidden>)
 >Re: Exit an Application (From: "Luca C." <email@hidden>)

  • Prev by Date: Re: Reading in dictionary from txt file: options for speed
  • Next by Date: Re: Reading in dictionary from txt file: options for speed
  • Previous by thread: Re: Exit an Application
  • Next by thread: Re: Exit an Application
  • Index(es):
    • Date
    • Thread