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

Re: NSArchiver question


  • Subject: Re: NSArchiver question
  • From: Will Mason <email@hidden>
  • Date: Sun, 24 Apr 2005 15:49:06 -0700 (PDT)
  • Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys

> However, it seems NSArchiver does not have methods for archiving
> basic
> C types (for example, there is encodeInt:forKey but there is no
> encodeInt:).  So what is the proper way to encode the primitive C
> types
> with NSArchiver?  Is it the encodeBytes:length: method?  Or maybe I
> have missed something obvious?

You can just use encodeValueOfObjCType:at:, like this:

// archiver is an instance of NSArchiver
int value = 12;
[archiver encodeValueOfObjCType: @encode(int) at: &value];

Take care,
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

  • Follow-Ups:
    • Re: NSArchiver question
      • From: Marcel Weiher <email@hidden>
  • Prev by Date: Need a little help with KVC Array operators
  • Next by Date: Conceptual help with CFMessagePort/NSMessagePort
  • Previous by thread: NSArchiver question
  • Next by thread: Re: NSArchiver question
  • Index(es):
    • Date
    • Thread