I would like to convert an UIImage
into unsigned char*
. First I convert UIImage
into NSData
, then NSData
to unsigned char*
. I use the following method to convert NSData
to unsigned char*
:
unsigned char *binaryData = (unsigned char *)[imageData bytes];
The problem is that there are many many bytes in imageData
(which is an NSData
), but after the method, the binaryData is just 0x75e8000
. I have no idea why. Could anybody help me out there? And can you suggest me one way to correctly convert NSData
to unsigned char*
?
Thanks in advance!!!