• 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: applicationWillTerminate: issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: applicationWillTerminate: issue


  • Subject: Re: applicationWillTerminate: issue
  • From: Kyle Sluder <email@hidden>
  • Date: Mon, 24 Aug 2009 17:42:47 -0700

On Mon, Aug 24, 2009 at 5:33 PM, Michael de Haan<email@hidden> wrote:
> 1) Is what I am seeing expected behavior or am I doing something wrong.

You're going to have to post your code.

-applicationWillTerminate: doesn't magically get called.
NSApplication posts this notification to the default notification
center.  NSApplication also automatically signs its delegate up for
this notification.

So at some point your "preference class" (whatever that means) is
signing up for the application will terminate notification.  Does it
do this by making itself the app delegate?  If so, then that would be
why your "other" implementation of -applicationWillTerminate: doesn't
get called.

> 2) Although not strictly speaking a cocoa question, would better design be
> to collect all "values/properties" to be saved in one location, thus
> avoiding the problem I am having?

You should be saving your preferences immediately, as soon as they are
changed in the UI.  You should not be waiting for your app to quit.

--Kyle Sluder
_______________________________________________

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: applicationWillTerminate: issue
      • From: Michael de Haan <email@hidden>
References: 
 >applicationWillTerminate: issue (From: Michael de Haan <email@hidden>)

  • Prev by Date: Re: NSTableView and programmatic changing of contextual menu
  • Next by Date: Re: NSTableView and programmatic changing of contextual menu
  • Previous by thread: applicationWillTerminate: issue
  • Next by thread: Re: applicationWillTerminate: issue
  • Index(es):
    • Date
    • Thread