• 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
Setting a prefs value at quit time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting a prefs value at quit time


  • Subject: Setting a prefs value at quit time
  • From: Graham Cox <email@hidden>
  • Date: Fri, 06 May 2016 09:38:00 +1000

I have a problem when my app quits on 10.9 (OK on 10.11):

0	__pthread_kill	10
1	abort	125
2	-[CFPrefsPlistSource alreadylocked_setValue:forKey:]	174
3	-[CFPrefsSource setValue:forKey:]	69
4	+[CFPrefsSource withSourceForIdentifier:user:byHost:container:perform:]	839
5	_CFPreferencesSetValueWithContainer	215
6	-[NSUserDefaults setObject:forKey:]	38


I set a value in NSUserDefaults on receiving the ‘app will quit’ notification. As you can see, there’s an issue where some internal check aborts because… well, not sure: ‘already locked’???

Is there some reason that a prefs value can’t be written at quit time? This only seems to cause this problem on 10.9, 10.11 is fine, haven’t tested on 10.10 yet. I also don’t think this was ever an issue on older OS either - this particular code is pretty old.

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?

—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: Setting a prefs value at quit time
      • From: Quincey Morris <email@hidden>
    • Re: Setting a prefs value at quit time
      • From: Alex Zavatone <email@hidden>
  • Prev by Date: Re: Progress bar problems on server persist
  • Next by Date: Re: Setting a prefs value at quit time
  • Previous by thread: Re: Progress bar problems on server persist
  • Next by thread: Re: Setting a prefs value at quit time
  • Index(es):
    • Date
    • Thread