• 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: Romain Marucchi <email@hidden>
  • Date: Fri, 20 Jun 2008 12:59:27 +0800


Tks Bryan, that does the trick! ;)

On Jun 20, 2008, at 12:49 PM, Bryan Henry wrote:

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:

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
References: 
 >Cocao Quit Application (From: Romain Marucchi <email@hidden>)
 >Re: Cocao Quit Application (From: Bryan Henry <email@hidden>)

  • Prev by Date: Re: Cocao Quit Application
  • Next by Date: Remote Debugging 10.5 to 10.4
  • Previous by thread: Re: Cocao Quit Application
  • Next by thread: Remote Debugging 10.5 to 10.4
  • Index(es):
    • Date
    • Thread