Re: Setting a prefs value at quit time
Re: Setting a prefs value at quit time
- Subject: Re: Setting a prefs value at quit time
- From: Graham Cox <email@hidden>
- Date: Fri, 06 May 2016 10:14:05 +1000
> On 6 May 2016, at 10:05 AM, Quincey Morris <email@hidden> wrote:
>
> On May 5, 2016, at 16:38 , Graham Cox <email@hidden> wrote:
>>
>> If it’s NOT legal to write a prefs value at quit time, how is one supposed to record persistent state that is only final by that time?
>
> Are you using an observer for NSApplicationWillTerminateNotification explicitly,
Yes.
> or the applicationWillTerminate delegate method? If yes to either (I assume they’re functionally equivalent), then you should probably use the applicationShouldTerminate delegate method instead, returning NSTerminateNow after saving the user defaults value unless you actually want to delay termination.
I’ll look into that. This is rather old code, so it hasn’t been looked at in some time, and hasn’t been updated for sudden termination, etc.
—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