• 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: Strange crash with multithreading and -[NSUserDefaults synchronize]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange crash with multithreading and -[NSUserDefaults synchronize]


  • Subject: Re: Strange crash with multithreading and -[NSUserDefaults synchronize]
  • From: Bill Bumgarner <email@hidden>
  • Date: Sun, 12 Nov 2006 13:51:56 -0800

On Nov 12, 2006, at 9:10 AM, Martin Redington wrote:
I've seen various previous threads which discuss the thread-safety, or not, of NSUserDefaults - I'm not so sure that they're directly relevant here, given that we still get the crashes when the NSUserDefaults calls are synchronized, or performed on the main thread.

NSUserDefaults is documented as thread safe. If it isn't, it is a bug. All things considered it is unlikely that NSUserDefaults has such a bug that prevents thread safety in such a normal usage pattern.


If anyone has seen something like this before, or has any tips on working out, from the debugger, what object its trying to access, that would be wonderful.

-synchronize causes the user defaults object to likely walk all of the user default's data in your app. As such, if you are over- releasing some object passed into the user defaults, it is likely that -synchronize might trip over it.


So, check your retain/release usage.  Try running with NSZombies.

b.bum

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Strange crash with multithreading and -[NSUserDefaults synchronize]
      • From: Martin Redington <email@hidden>
References: 
 >Strange crash with multithreading and -[NSUserDefaults synchronize] (From: Martin Redington <email@hidden>)

  • Prev by Date: XMPP framework?
  • Next by Date: Re: How to Optimize drawRect: for obscured views?
  • Previous by thread: Strange crash with multithreading and -[NSUserDefaults synchronize]
  • Next by thread: Re: Strange crash with multithreading and -[NSUserDefaults synchronize]
  • Index(es):
    • Date
    • Thread