Re: Colors and NSUserDefaults
Re: Colors and NSUserDefaults
- Subject: Re: Colors and NSUserDefaults
- From: Nathan Day <email@hidden>
- Date: Sun, 7 Jul 2002 21:21:52 +0930
Only property list types can go into NSUserDefaults, which are NSString,
NSNumber, NSData, NSArray where all of the element are property list
types, NSDictionary where the keys are NSStrings and the objects are
property list types. Converting NSColor into a property list type has
been discussed before and the solution is to convert it into NSData or
into an NSArray containing NSNumbers for each component.
On Sunday, July 7, 2002, at 09:11 PM, Jeremy Dronfield wrote:
>
I'm trying to put a colour value into my NSUserDefaults object. I tried
>
using:
>
>
[prefs setObject:[myColorWell color] forKey:@"ColorSetting"];
>
>
which gives me a signal 10. There's nothing wrong with my prefs object;
>
it puts other values into the .plist file perfectly well. Also,
>
myColorWell performs its function in the application just fine, so
>
there can't be a problem with that. The only other default setting
>
methods are bool, float and integer, none of which are appropriate.
>
- Jeremy.
_______________________________________________
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.