• 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: Saving NSColor
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Saving NSColor
      • From: Ali Ozer <email@hidden>
    • Re: Saving NSColor
      • From: Christopher Holland <email@hidden>
References: 
 >Saving NSColor (From: Julien Guimont <email@hidden>)

  • Prev by Date: Saving NSColor
  • Next by Date: Re: Best way to push action from 1 thread to another?
  • Previous by thread: Saving NSColor
  • Next by thread: Re: Saving NSColor
  • Index(es):
    • Date
    • Thread