Re: Saving NSColor
Re: Saving NSColor
- Subject: Re: Saving NSColor
- From: Mike Beam <email@hidden>
- Date: Fri, 10 May 2002 09:35:01 -0500
NSUserDefaults can only save a few data types to file such as NSString,
NSNumber, NSDictionary, NSArray, and NSData (there might be more, but I
can't think of them off the top of my head). Since we can save NSData to
the user defaults, you can archive your NSColor object and store the
resulting NSData; later you can retrieve the NSData from user defaults and
unarchive it into an NSColor object. Check out the class documentation for
NSArchiver and NSUnarchiver for more information. Storing the RGB values as
you suggest is also a possibility, but I think archiving is more "elegant"
and straightforward. Hope that helps...
Mike Beam
_______________________________________________
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.