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

Re: NSUserDefaults question


  • Subject: Re: NSUserDefaults question
  • From: Chris Parker <email@hidden>
  • Date: Tue, 5 Mar 2002 10:00:55 -0800

Hi Angela,

On Tuesday, March 5, 2002, at 02:31 AM, Angela Brett wrote:

[code to write to a specific domain snipped]

which is quite a bit more complicated than just using [[NSUserDefaults standardUserDefaults] setObject:myObject forKey:myKey] which I would do to save a default to the specific defaults for that app.

I know that I could do it in one line with CFPreferencesSetAppValue((CFStringRef)myKey,myObject,CFSTR("My Main Defaults thingy"));

So, if there is a simple one-line way of changing a single default for the app name of my choice in CoreFoundation, how come there isn't a method like that in NSUserDefaults? Or is there one, and I just haven't see it?

Well it's mainly that NSUserDefaults doesn't expose all the features of CFPreferences (like being able to write to a specific domain without jumping through those hoops). Likewise CFPreferences doesn't do all the things NSUserDefaults does (volatile domains, argument domain, etc).

In the meantime you can certainly use the CF routine to do this.

.chris

--
Chris Parker <email@hidden>
Cocoa Frameworks Engineer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSUserDefaults question (From: Angela Brett <email@hidden>)

  • Prev by Date: Re: Parsing strings? File getline?
  • Next by Date: Re: Key Binding Dictionary
  • Previous by thread: NSUserDefaults question
  • Next by thread: Re: NSUserDefaults question
  • Index(es):
    • Date
    • Thread