Re: NSCoding question regarding BOOL
Re: NSCoding question regarding BOOL
- Subject: Re: NSCoding question regarding BOOL
- From: Will Mason <email@hidden>
- Date: Fri, 4 Feb 2005 21:54:30 -0800 (PST)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
--- Aaron Boothello <email@hidden> wrote:
> I'm implementing the NSCoding protocol, and all seems to be going on
> pretty well. I can save my objects easily, but im having troble
> saving data that's of type 'BOOL'. Can someone help me out here?
You can use [NSCoder encodeValueOfObjCType:at:], like this:
BOOL doggy = YES;
/* coder is an instance of NSArchiver */
[coder encodeValueOfObjCType: @encode(BOOL) at: &doggy];
Or, if you're using keyed archives:
/* keyedCoder is an instance of NSKeyedArchiver */
[keyedCoder encodeBool: doggy forKey: @"doggyBoy"];
Will
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden