Re: NSUserDefaults, an array, and SIGBUS 10
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.