Re: NSUserDefaultsController
Re: NSUserDefaultsController
- Subject: Re: NSUserDefaultsController
- From: Scott Anguish <email@hidden>
- Date: Sun, 9 Nov 2003 00:30:20 -0500
On Nov 8, 2003, at 11:03 PM, James Spencer wrote:
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.
are you setting the initial values for the NSUserDefaultsController
anywhere? I found that it had to be in a +initialize method that would
get called early in the load. (like AppDelegate)
_______________________________________________
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.