Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display hexadecimal bytes using NSLog

How can I display the following bytes using NSLog?

const void *devTokenBytes = [devToken bytes];
like image 262
gabac Avatar asked Sep 14 '10 16:09

gabac


1 Answers

Assuming that devToken is of type NSData * (from the bytes call), you can use the description method on NSData to get a string containing the hexadecimal representation of the data's bytes. See the NSData class reference.

NSLog(@"bytes in hex: %@", [devToken description]);
like image 53
Tim Avatar answered Oct 25 '22 10:10

Tim