On Fri, Dec 11, 2009 at 11:10 PM, Jerry Krinock <je...@ieee.org> wrote:
> Sorry for the wonky subject.  It's easier to explain in code:
>
> NSNumber* innerKey = [NSNumber numberWithInt:0] ;
> NSDictionary* dic = [NSDictionary dictionaryWithObject:@"Hello"
>                                                forKey:innerKey] ;
> [[NSUserDefaults standardUserDefaults] setObject:dic
>                                          forKey:@"outerKey"] ;
>
> Result:
>
> *** -[NSUserDefaults setObject:forKey:]: Attempt to insert non-property value 
> '{
>    0 = Hello;
> }' of class 'NSCFDictionary'.

The message printed is unfortunate, as it doesn't really tell you what
is wrong (please file a bug). It's fine to have numbers as keys in
dictionaries; however keys property lists (and therefore in user
defaults) must be strings.

-- 
Clark S. Cox III
clarkc...@gmail.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to