• 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: NSKeyedArchiver and NSPoints
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSKeyedArchiver and NSPoints


  • Subject: Re: NSKeyedArchiver and NSPoints
  • From: Graham Cox <email@hidden>
  • Date: Thu, 29 Apr 2010 11:37:57 +1000

On 29/04/2010, at 5:45 AM, Raffael Cavallaro wrote:

>
> On Apr 28, 2010, at 3:31 PM, Quincey Morris wrote:
>
>> So my original point stands: I want my original bit pattern back again after unarchiving, and I don't believe that a finite decimal string will guarantee that.
>
> As a practical matter, a simple test shows that converting the point:
>
> 3.141592653589793, 3.141592653589793
>
> using NSStringFromPoint gives you the string:
>
> "{3.14159, 3.14159}"
>
> so, yeah, you're not getting what you want.


Hmm, that's worse than I thought (I could have sworn it used substantially more precision than that!).

Really, the OP's best bet is to make his original class NSCoding compliant and archive it directly, then he can use -encodePoint:forKey:. Going the string-wrapper route now looks more trouble than it's worth, though Clark Cox's solution would do it.

--Graham


_______________________________________________

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

References: 
 >NSKeyedArchiver and NSPoints (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: NSKeyedArchiver and NSPoints (From: Graham Cox <email@hidden>)
 >Re: NSKeyedArchiver and NSPoints (From: Jean-Daniel Dupas <email@hidden>)
 >Re: NSKeyedArchiver and NSPoints (From: Graham Cox <email@hidden>)
 >Re: NSKeyedArchiver and NSPoints (From: Quincey Morris <email@hidden>)
 >Re: NSKeyedArchiver and NSPoints (From: Kyle Sluder <email@hidden>)
 >Re: NSKeyedArchiver and NSPoints (From: Quincey Morris <email@hidden>)
 >Re: NSKeyedArchiver and NSPoints (From: Raffael Cavallaro <email@hidden>)

  • Prev by Date: Re: advancementForGlyph problem
  • Next by Date: Re: UIView, UILabel, and sizeToFit
  • Previous by thread: Re: NSKeyedArchiver and NSPoints
  • Next by thread: Re: NSKeyedArchiver and NSPoints
  • Index(es):
    • Date
    • Thread