• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Colors and NSUserDefaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Colors and NSUserDefaults


  • Subject: Re: Colors and NSUserDefaults
  • From: Jeremy Dronfield <email@hidden>
  • Date: Tue, 9 Jul 2002 21:56:51 +0100

It works perfectly. Thanks for drawing it to my attention. My colour-related code is now about 70 per cent shorter than it was!
- Jeremy.

On Tuesday, July 9, 2002, at 03:50 pm, Paul Ferguson wrote:

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

References: 
 >Re: Colors and NSUserDefaults (From: Paul Ferguson <email@hidden>)

  • Prev by Date: NSView subclasses and app design
  • Next by Date: Re: Are NSScanners deprecated?
  • Previous by thread: Re: Colors and NSUserDefaults
  • Next by thread: Re: Colors and NSUserDefaults
  • Index(es):
    • Date
    • Thread