• 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: NSUserDefaults, an array, and SIGBUS 10
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSUserDefaults, an array, and SIGBUS 10


  • Subject: Re: NSUserDefaults, an array, and SIGBUS 10
  • From: Ondra Cada <email@hidden>
  • Date: Mon, 29 Jul 2002 14:32:24 +0200

On Monday, July 29, 2002, at 07:59 , Scott Anguish wrote:

this category on NSUserDefaults adds support for archiving NSColor.. you can see from this how to archive your own data

- (void)setColor:(NSColor *)color forKey:(NSString *)key {
NSData *data=[NSArchiver archivedDataWithRootObject:color];
[self setObject:data forKey:key];
}

Although this works perfectly for any object(*), for colours and similar values it is much better -- if possible -- to use some string- or number-based encoding (like RGB values). The difference lays in the possibility to change the default value easily externally, eg. using the CLI defaults tool.

(*) which is archivable, but most are.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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: NSUserDefaults, an array, and SIGBUS 10
      • From: Scott Anguish <email@hidden>
References: 
 >Re: NSUserDefaults, an array, and SIGBUS 10 (From: Scott Anguish <email@hidden>)

  • Prev by Date: Re: ask about sleep function
  • Next by Date: Re: Putting NSToolbar in an NSView...
  • Previous by thread: Re: NSUserDefaults, an array, and SIGBUS 10
  • Next by thread: Re: NSUserDefaults, an array, and SIGBUS 10
  • Index(es):
    • Date
    • Thread