I am just trying to print out UInt16 pointer to my log, So i can see its contence… however thus far am not having any sucsess, dose anyone know how to do this, I am thinking its the format specifier but because I dont have alot of experience with this type of thing I just dont know. the warning I am getting is “initialization discards qualifiers from pointer target type”
//....
[nissanCode seekToFileOffset: 2];
dataBuffer = [nissanCode readDataOfLength:SETSIZE];
UInt16 *ans = dataBuffer.bytes;
UInt16 a = *ans;
NSLog (@"Data = %@", a);
//....
//Revised code that clears the warning and prints data out fine. thanks for the help guys.
//....
[nissanCode seekToFileOffset: 2];
dataBuffer = [nissanCode readDataOfLength:SETSIZE];
const UInt16 *ans = dataBuffer.bytes;
NSLog (@"Data = %d", a);
//....
try using for int’s
or for your UInt16’s (thanks to @bshirley for the list of format specifiers below)