• 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: "Jonathan E. Jackel" <email@hidden>
  • Date: Thu, 19 Dec 2002 10:20:04 -0500

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"?

Jonathan


> I do something like the following in my application
>
> [defaults setObject:@"some string" forKey:@"myKey"];
>
> later after restarting the program, I do something like
>
> NSString *myString;
> myString = [defaults objectForKey:@"myKey"];
> if (myString != nil)
> {
> // do something
> }
> else
> NSLog(@"myKey is missing");
>
> which logs "myKey is missing" every time. After reading the
> documentation on User Defaults several times over I no grok. Is there
> something I have to do in my application bundle before I can set objects
> in the Application domain, or am I missing something more basic? Where
> is the User Defaults dictionary stored? Is there some way to inspect it?
>
> I'm an old NeXT developer from way back, but I'm having to learn a few
> new tricks with Cocoa.
>
> Cheers, Eric
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSUserDefauts - Am I Missing the Obvious?
      • From: Jaime Magiera <email@hidden>
    • RE: NSUserDefauts - Am I Missing the Obvious?
      • From: Jacques <email@hidden>
References: 
 >NSUserDefauts - Am I Missing the Obvious? (From: Eric Kolotyluk <email@hidden>)

  • Prev by Date: Re: "First Run" installation of Application support stuff?
  • Next by Date: Applets within Wrapper that need root/administrative privileges
  • Previous by thread: Re: NSUserDefauts - Am I Missing the Obvious?
  • Next by thread: RE: NSUserDefauts - Am I Missing the Obvious?
  • Index(es):
    • Date
    • Thread