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 (Cocoa-dev@lists.apple.com)
>> 
>> 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:
>> http://lists.apple.com/mailman/options/cocoa-dev/gandreas%40mac.com
>> 
>> This email sent to gandr...@mac.com
> 
> Glenn Andreas                      gandr...@gandreas.com 
> The most merciful thing in the world ... is the inability of the human mind 
> to correlate all its contents - HPL
> 

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to