• 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
Best practice for terminating at launch time?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Best practice for terminating at launch time?


  • Subject: Best practice for terminating at launch time?
  • From: Graham Cox <email@hidden>
  • Date: Wed, 11 Feb 2009 10:39:41 +1100

Under some circumstances (e.g. expired license), I want my app to present a message to the user at launch time then Quit when they dismiss the message. I'm wondering what the best way to do this is.

I thought I'd put my checks in the app delegate's - applicationWillFinishLaunching: method, but when I present the alert using [NSAlert runModal], the app continues opening a new document in the background, and the alert itself ends up inactive. While the user can't do anything with the opened document (and the menubar isn't installed either), it's all a bit ugly. So my first question is about how to handle that more cleanly.

The next question is about actually terminating. I currently simply call [NSApp terminate:] which works, but I'm a bit worried that there could be a way that this won't actually Quit, since it's only a request to Quit, not a command. For example if the user launched the app by double-clicking a file that needs some conversion as it's read in, the document gets marked as dirty, and that allows a way for the user to cancel the Quit. Is there a way to legally Quit an app, no questions asked?

tia,

--Graham


_______________________________________________

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


  • Follow-Ups:
    • Re: Best practice for terminating at launch time?
      • From: Rob Keniger <email@hidden>
  • Prev by Date: Re: One Shot Windows: WARNING
  • Next by Date: Re: NSToolbarItems - deallocating view-based items
  • Previous by thread: [MEET] CocoaHeads-NYC meeting Thu 02/12
  • Next by thread: Re: Best practice for terminating at launch time?
  • Index(es):
    • Date
    • Thread