• 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
float from NSData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

float from NSData


  • Subject: float from NSData
  • From: Jay Kickliter <email@hidden>
  • Date: Mon, 2 Mar 2009 20:32:36 -0500

I have a case where I'm sending IEEE 754 32-bit floats to my Cocoa program over a wireless serial link, they are being sent MSB first. I'm using AMSerialPort to handle my data, and after a little parsing, I'm left with a 4 byte NSData, which has the 32-bit float split into 4 bytes.

I know I have to play around to make sure the bytes are in the right order. But what I can't seem to figure out, is how I create a float from those 4 bytes stored in an instance of NSData. Has anybody run into this situation? _______________________________________________

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:
    • Re: float from NSData
      • From: "Sean McBride" <email@hidden>
    • Re: float from NSData
      • From: Ben Lachman <email@hidden>
    • Re: float from NSData
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: Do I need to relase @"string" ??
  • Next by Date: Re: float from NSData
  • Previous by thread: Re: NSFileManager reads from invalid memory
  • Next by thread: Re: float from NSData
  • Index(es):
    • Date
    • Thread