Re: NSData hexadecimal to 16 bit integer?
Re: NSData hexadecimal to 16 bit integer?
- Subject: Re: NSData hexadecimal to 16 bit integer?
- From: Nick Zitzmann <email@hidden>
- Date: Sat, 28 May 2005 11:09:50 -0600
On May 28, 2005, at 3:55 AM, Nick Morris wrote:
The above gives '<docf>', which matches the start of a hex dump of
the file using BBEdit.
D0 CF 11 E0 A1 B1 1A E1 00 00 00 00 00 00 00 00
The dumb question is.....
How do I convert 'theData', i.e. docf, to an integer (53455).
Just declare an integer as normal, and then use the -[NSData
getBytes:length:] method to copy the first two bytes (D0 CF) into the
integer:
int yourInt;
[theData getBytes:&yourInt length:2];
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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