• 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: Multiple instances of [NSUserDefaults standardUserDefaults]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple instances of [NSUserDefaults standardUserDefaults]


  • Subject: Re: Multiple instances of [NSUserDefaults standardUserDefaults]
  • From: Chris Idou <email@hidden>
  • Date: Sat, 23 Oct 2010 04:13:47 -0700 (PDT)


Well, I've got some code, which I presume used to work, which relies on
observing a value in the user defaults. The observer isn't getting triggered, so
I am guessing it is because they are separate instances. Both should be on the
main thread.



----- Original Message ----
From: Dave Keck <email@hidden>
To: Chris Idou <email@hidden>
Cc: email@hidden
Sent: Sat, 23 October, 2010 10:05:01 PM
Subject: Re: Multiple instances of [NSUserDefaults standardUserDefaults]

> Has anyone got any thoughts?

I wouldn't be surprised if there's a separate NSUserDefaults instance
for each thread. Regardless though, it's an implementation detail that
shouldn't be relied on unless the docs guarantee certain behavior.

Could you explain why you need to rely on NSUserDefaults returning the
same instance on each invocation of -standardUserDefaults?




_______________________________________________

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: Multiple instances of [NSUserDefaults standardUserDefaults]
      • From: Dave Keck <email@hidden>
References: 
 >Multiple instances of [NSUserDefaults standardUserDefaults] (From: Chris Idou <email@hidden>)
 >Re: Multiple instances of [NSUserDefaults standardUserDefaults] (From: Dave Keck <email@hidden>)

  • Prev by Date: Re: Multiple instances of [NSUserDefaults standardUserDefaults]
  • Next by Date: Re: Multiple instances of [NSUserDefaults standardUserDefaults]
  • Previous by thread: Re: Multiple instances of [NSUserDefaults standardUserDefaults]
  • Next by thread: Re: Multiple instances of [NSUserDefaults standardUserDefaults]
  • Index(es):
    • Date
    • Thread