• 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: problem with [NSData bytes] on Intel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with [NSData bytes] on Intel


  • Subject: Re: problem with [NSData bytes] on Intel
  • From: john <email@hidden>
  • Date: Mon, 6 Feb 2006 18:18:28 -0500

Hi,

Doug was correct on this issue. It was audio related, and although I didn't need to swap the bytes manually I wasn't specifying the audio format (from CoreAudio) correctly so I was getting this problem which seemed rather confusing at the time :)

-- John


Er, I'm not sure I'm interpreting you correctly ... but it does sound like John's problem could be endian-related.

If you have an NSData containing floats that came from an opposite- endian processor, you have to swap them, e.g.

NSData *bigEndianFloats = ...;
const UInt32 *ptr = [bigEndianFloats bytes];
UInt32 temp = EndianU32_BtoN(ptr[0]);
Float32 firstFloat = *(Float32 *)&temp;

HTH,
Doug
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >problem with [NSData bytes] on Intel (From: john <email@hidden>)
 >Re: problem with [NSData bytes] on Intel (From: Markus Hitter <email@hidden>)
 >Re: problem with [NSData bytes] on Intel (From: Camillo Lugaresi <email@hidden>)
 >Re: problem with [NSData bytes] on Intel (From: Markus Hitter <email@hidden>)
 >Re: problem with [NSData bytes] on Intel (From: Camillo Lugaresi <email@hidden>)
 >Re: problem with [NSData bytes] on Intel (From: Doug Wyatt <email@hidden>)

  • Prev by Date: Re: Core Data, binding & selecting table rows upon document open
  • Next by Date: Re: NSTextView and limiting text attributes via delegate
  • Previous by thread: Re: problem with [NSData bytes] on Intel
  • Next by thread: Re: problem with [NSData bytes] on Intel
  • Index(es):
    • Date
    • Thread