• 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: Reading old NSArchiver serialization, expecting CGRect, finding {?={?=ff}{?=ff}}
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading old NSArchiver serialization, expecting CGRect, finding {?={?=ff}{?=ff}}


  • Subject: Re: Reading old NSArchiver serialization, expecting CGRect, finding {?={?=ff}{?=ff}}
  • From: Philip Dow <email@hidden>
  • Date: Wed, 13 Jul 2011 12:47:42 -0500

Brilliant. Thank you Glenn. I compiled the app for 32 bit and it read the archive fine. I've created my own struct with floats for reading the archive in 64 bit and am coercing the data into doubles after the decoding.

~Phil

On Jul 13, 2011, at 12:30 PM, glenn andreas wrote:

> Are you decoding it from a 64 bit app?  Because CGRect on 64 bits is made of doubles, while on 32 bits (where it was probably encoded) it was made of floats....
>
> Also, the exact format for @encode() varies greatly between compiler version (especially with regards for things like structure names vs ?, etc...).  This, in and of itself, shouldn't make it incompatible, but a structure with two structures each with two floats doesn't match with the double-based CGRect.
>
> On Jul 13, 2011, at 12:20 PM, Philip Dow wrote:
>
>> I am trying to decode a 3rd party archive encoded in the old NSArchiver (not keyed) format. At a point in the decoding, I expect to find a CGRect, but when I call
>>
>> [coder decodeValueOfObjCType:@encode(CGRect) at:&myRect]
>>
>> an exception is raised with the error:
>>
>> file inconsistency: read '{?={?=ff}{?=ff}}', expecting '{CGRect={CGPoint=dd}{CGSize=dd}}'
>>
>> Sure enough, if I open the file in a text editor, I see {?={?=ff}{?=ff}}.
>>
>> According to the docs, the curly braces indicate a structure is encoded, which I would expect for CGRect, but the ? indicates an unknown type. I'm stumped for a solution and was wondering if anyone might have an insight.
>>
>> ~Phil_______________________________________________
>>
>> 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
>
> Glenn Andreas                      email@hidden
> The most merciful thing in the world ... is the inability of the human mind to correlate all its contents - HPL
>

_______________________________________________

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:
    • 32 -> 64 bit serializations, NSNumber, int, NSInteger
      • From: Philip Dow <email@hidden>
References: 
 >Reading old NSArchiver serialization, expecting CGRect, finding {?={?=ff}{?=ff}} (From: Philip Dow <email@hidden>)
 >Re: Reading old NSArchiver serialization, expecting CGRect, finding {?={?=ff}{?=ff}} (From: glenn andreas <email@hidden>)

  • Prev by Date: Re: Cocoa Touch: Accessory view never calls "up outside" action?
  • Next by Date: iPad, UISplitView, and Refreshing Menu Items
  • Previous by thread: Re: Reading old NSArchiver serialization, expecting CGRect, finding {?={?=ff}{?=ff}}
  • Next by thread: 32 -> 64 bit serializations, NSNumber, int, NSInteger
  • Index(es):
    • Date
    • Thread