Re: NSUserDefaults won't do as it's told
Re: NSUserDefaults won't do as it's told
- Subject: Re: NSUserDefaults won't do as it's told
- From: Rosyna <email@hidden>
- Date: Sat, 3 Mar 2007 08:43:09 -0700
Are there errors at runtime? NSAttributedString is not a property
list type. NSString is, however.
Also, you leak a lot in this code.
Ack, at 3/3/07, email@hidden said:
That is, the return value is nil, and the code just executed was all in
vain ! As usual, I
must be missing something obvious ...
Below is the aforementioned code for the "initialize" method :
+(void) initialize
{
NSMutableDictionary* defaultValues=[NSMutableDictionary dictionary];
NSData* yellowData=[NSKeyedArchiver archivedDataWithRootObject:[NSColor
yellowColor]];
NSData* greenData=[NSKeyedArchiver archivedDataWithRootObject:[NSColor
greenColor]];
[defaultValues setObject:[[NSAttributedString alloc]
initWithString:@"\n%"] forKey:GGPeggyHeaderContentKey];
[defaultValues setObject:[[NSAttributedString alloc]
initWithString:@"\n%"] forKey:GGPeggyFooterContentKey];
[defaultValues setObject:yellowData forKey:GGPeggyHeaderColorKey];
[defaultValues setObject:greenData forKey:GGPeggyFooterColorKey];
[defaultValues setObject:[NSNumber numberWithBool:YES]
forKey:GGMultiplePageViewBooleanKey];
[[NSUserDefaults standardUserDefaults] registerDefaults: defaultValues];
}
Note : there are no warnings during the compile phase.
--
Sincerely,
Rosyna Keller
Technical Support/Carbon troll/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden