Re: Colors and NSUserDefaults
Re: Colors and NSUserDefaults
- Subject: Re: Colors and NSUserDefaults
- From: Paul Ferguson <email@hidden>
- Date: Tue, 9 Jul 2002 07:50:23 -0700
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.
Take a look at the JabberFoX source code (jabberfox.sourceforge.net).
The files NSUserDefaults-Colors.h/.m adds two methods to NSUserDefaults:
- (NSColor *)colorForKey:(NSString *)defaultName;
- (void)setColor:(NSColor *)value forKey:(NSString *)defaultName;
that make saving and restoring color preferences trivial.
_______________________________________________
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.