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

Re: NSUserDefaultsController


  • Subject: Re: NSUserDefaultsController
  • From: James Spencer <email@hidden>
  • Date: Sat, 8 Nov 2003 22:03:31 -0600

On Nov 8, 2003, at 4:04 PM, mmalcolm crawford wrote:

On Nov 8, 2003, at 1:05 PM, James Spencer wrote:
NSData * tempData = [[[NSUserDefaultsController sharedUserDefaultsController]
defaults] valueForKey:@"smtpServer"];
but what is returned is a data object and I can't figure out how to convert this object back into my NSString.

NSString * server = [[[NSUserDefaultsController sharedUserDefaultsController]
defaults] stringForKey:@"smtpServer"];

Thank you very much for this as it allows me to ask a more intelligent question, or at least I hope its more intelligent. This is what I initially tried. Unfortunately, what is being returned in server is nil. I've double checked the key, going to the extent of copying it and pasting it from Interface Builder and I know there is in fact a valid value in the defaults because when I quit the application and restart it, it is correctly putting the value into my Preferences window.

Any hints on what I might look at to figure out why I'm coming up with no string?

Spence

James P. Spencer
Rochester, MN

email@hidden

"Badges?? We don't need no stinkin badges!"
_______________________________________________
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: NSUserDefaultsController
      • From: mmalcolm crawford <email@hidden>
    • Re: NSUserDefaultsController
      • From: Scott Anguish <email@hidden>
References: 
 >NSUserDefaultsController (From: James Spencer <email@hidden>)
 >Re: NSUserDefaultsController (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Code Example from WWDC
  • Next by Date: Re: High performance fade-in/fade-out of image
  • Previous by thread: Re: NSUserDefaultsController
  • Next by thread: Re: NSUserDefaultsController
  • Index(es):
    • Date
    • Thread