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'.

If I change innerKey to a string such as @"0", then all works fine.

In my opinion, after reading the documentation carefully, this exception is a 
false alarm.  First of all, NSCFDictionary *is*, as required, one of the 
"property list" objects: NSData, NSString, NSNumber, NSDate, NSArray, or 
NSDictionary.  Furthermore, all of its objects and keys are themselves property 
list objects.  Furthermore, NSNumber conforms to NSCopying protocol, as 
required for dictionary keys.

Is there some other requirement that I missed?

Jerry Krinock

_______________________________________________

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