• 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: My NSSwappedDouble decoding crashes on iPhone 4
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: My NSSwappedDouble decoding crashes on iPhone 4


  • Subject: Re: My NSSwappedDouble decoding crashes on iPhone 4
  • From: Markus Spoettl <email@hidden>
  • Date: Wed, 29 Sep 2010 10:53:18 -0400

On Sep 29, 2010, at 2:41 AM, Markus Spoettl wrote:
> The the Mac code is 32bit and runs on Leopard and Snow Leopard.
>
> - (void)encodeDouble:(double)value forKey:(NSString *)key withCoder:(NSCoder *)encoder
> {
>    NSSwappedDouble sd = NSSwapHostDoubleToLittle(value);
>    [encoder encodeBytes:(const uint8_t *)&sd length:sizeof(NSSwappedDouble) forKey:key];
> }
>
> - (double)decodeDoubleForKey:(NSString *)key withCoder:(NSCoder *)decoder
> {
>    double result = 0.0;
>    NSUInteger retsize;
>    NSSwappedDouble *sd = (NSSwappedDouble *)[decoder decodeBytesForKey:key returnedLength:&retsize];
>    if (retsize == sizeof(NSSwappedDouble)) {  // <=== crash
>        result = NSSwapLittleDoubleToHost(*sd);
>    }
>    return result;
> }


I just noticed the unfamiliar exception code EXC_ARM_DA_ALIGN. Googling it turns up that I'm not the only one experiencing the issue. I'll post a solution when I have it ready. Sorry for the noise.

Regards
Markus

--
__________________________________________
Markus Spoettl

_______________________________________________

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: 
 >My NSSwappedDouble decoding crashes on iPhone 4 (From: Markus Spoettl <email@hidden>)

  • Prev by Date: Core data: Inverse relationships with subclasses
  • Next by Date: Re: Acquiring an NSConnection otherwise than by registered name?
  • Previous by thread: My NSSwappedDouble decoding crashes on iPhone 4
  • Next by thread: Background-Task (Timer)
  • Index(es):
    • Date
    • Thread