• 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: Cocao Quit Application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocao Quit Application


  • Subject: Re: Cocao Quit Application
  • From: Bryan Henry <email@hidden>
  • Date: Fri, 20 Jun 2008 00:49:14 -0400

This is off-topic for this list, you should try Cocoa Dev in the future.

[NSApp terminate:self] should work, as long as you don't have modal windows or such open since it will check applicationShouldTerminate: for that to work. The absolute sure-fire way to kill the application is to go to C and use "exit(SUCCESS_CODE_HERE)", but that doesn't do anything cleanly at all so you wouldn't want to use that for an app with file operations or networking and such. The clean way is to just use -[NSApplication terminate:].

P.S.
NSApp is a shortcut for [NSApplication sharedApplication]

Bryan

On Jun 20, 2008, at 12:35 AM, Romain Marucchi wrote:

What is the obj-c code to make an application quit ie: on an click, similar as Apple Key + Q?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@mac.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Cocao Quit Application
      • From: Romain Marucchi <email@hidden>
References: 
 >Cocao Quit Application (From: Romain Marucchi <email@hidden>)

  • Prev by Date: Re: Cocao Quit Application
  • Next by Date: Re: Cocao Quit Application
  • Previous by thread: Re: Cocao Quit Application
  • Next by thread: Re: Cocao Quit Application
  • Index(es):
    • Date
    • Thread