Re: Colors and NSUserDefaults
Re: Colors and NSUserDefaults
- Subject: Re: Colors and NSUserDefaults
- From: Matt Judy <email@hidden>
- Date: Mon, 08 Jul 2002 01:19:20 -0700
You should archive the color into data first. Something along these
lines is effective:
[[NSUserDefaults standardUserDefaults] setObject:[NSArchiver
archivedDataWithRootObject:myColor] forKey:@"savedColor"];
To restore:
myColor = [NSUnarchiver unarchiveObjectWith
Data:[[NSUserDefaults
standardUserDefaults] dataForKey:@"savedColor"]]
--Matt
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.
_______________________________________________
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.