• 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: coding NSNumber in NSArray?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coding NSNumber in NSArray?


  • Subject: Re: coding NSNumber in NSArray?
  • From: Jens Alfke <email@hidden>
  • Date: Mon, 14 Sep 2009 10:38:50 -0700


On Sep 14, 2009, at 10:17 AM, Quincey Morris wrote:

Whatever your question is, the answer likely is: don't try to use 'encodeObject:forKey:' to encode NSNumber objects. Use one of the variants like "encodeInteger:forKey:" or "encodeInt32:forKey:" -- you need to tell the archiver which *kind* of external representation to use for the number.

That's not true. NSNumber implements NSCoding, so it's perfectly capable of archiving and unarchiving itself. It already knows internally what the number's representation is.


—Jens

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: coding NSNumber in NSArray?
      • From: Quincey Morris <email@hidden>
References: 
 >coding NSNumber in NSArray? (From: jon <email@hidden>)
 >Re: coding NSNumber in NSArray? (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Audio Unit problem in Snow Leopard
  • Next by Date: Re: Help book content
  • Previous by thread: Re: coding NSNumber in NSArray?
  • Next by thread: Re: coding NSNumber in NSArray?
  • Index(es):
    • Date
    • Thread