• 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: NSUserDefaults won't do as it's told
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSUserDefaults won't do as it's told (From: email@hidden)

  • Prev by Date: Re: NSUnionRect
  • Next by Date: Re: Preventing beach balls
  • Previous by thread: NSUserDefaults won't do as it's told
  • Next by thread: Re: NSUserDefaults won't do as it's told
  • Index(es):
    • Date
    • Thread