• 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: NSUserDefauts - Am I Missing the Obvious?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: NSUserDefauts - Am I Missing the Obvious?


  • Subject: RE: NSUserDefauts - Am I Missing the Obvious?
  • From: Jacques <email@hidden>
  • Date: Thu, 19 Dec 2002 17:05:10 +0100

Le jeudi 19 dicembre 2002, Jonathan E. Jackel disait :

>This may be way too obvious an answer, but I'll try it. It is not clear
>from the code below what "defaults" is. Have you tried substituting
>[NSUserDefaults standardUserDefaults] where you now have "defaults"?


You have to do something like that :

NSUserDefaults* defaults;

defaults = [NSUserDefaults standardUserDefaults];

[firstNameField setStringValue:[defaults stringForKey:@"fistName"]];

And to read ans store the prefs :

[[NSUserDefaults standardUserDefaults] setObject:[firstnameField stringValue]
forKey:@"firstname"];

And may be a :

[[NSUserDefaults standardUserDefaults] synchronize];

At the end of your "writePrefs" method.

Jacques
--
_______________________________________________
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: 
 >RE: NSUserDefauts - Am I Missing the Obvious? (From: "Jonathan E. Jackel" <email@hidden>)

  • Prev by Date: Still an Interesting Bug
  • Next by Date: Re: Still an Interesting Bug
  • Previous by thread: RE: NSUserDefauts - Am I Missing the Obvious?
  • Next by thread: Re: NSUserDefauts - Am I Missing the Obvious?
  • Index(es):
    • Date
    • Thread