• 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: NSData hexadecimal to 16 bit integer?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSData hexadecimal to 16 bit integer?


  • Subject: Re: NSData hexadecimal to 16 bit integer?
  • From: Andreas Monitzer <email@hidden>
  • Date: Sat, 28 May 2005 13:16:29 +0200

On May 28, 2005, at 11:55, Nick Morris wrote:

--------  Code --------

NSData *theFileData = [NSData dataWithContentsOfFile:aValidFlePath];
NSData *theData = [NSData dataWithData:[theFileData subdataWithRange:NSMakeRange(0,2)]];


NSLog(@"%@", theData);

--------  End Code --------

The dumb question is.....

How do I convert 'theData', i.e. docf, to an integer (53455).

NSLog(@"%d",*(int*)[theData bytes]);

andy

_______________________________________________
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: 
 >NSData hexadecimal to 16 bit integer? (From: Nick Morris <email@hidden>)

  • Prev by Date: NSData hexadecimal to 16 bit integer?
  • Next by Date: Re: Help manipulate pixel data with Core Image and Core Video etc
  • Previous by thread: NSData hexadecimal to 16 bit integer?
  • Next by thread: Re: NSData hexadecimal to 16 bit integer?
  • Index(es):
    • Date
    • Thread