• 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: NSCoding question regarding BOOL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSCoding question regarding BOOL (From: Aaron Boothello <email@hidden>)

  • Prev by Date: checking if an object's instance exists.
  • Next by Date: Re: NSCoding question regarding BOOL
  • Previous by thread: NSCoding question regarding BOOL
  • Next by thread: Re: NSCoding question regarding BOOL
  • Index(es):
    • Date
    • Thread