我只是试图打印出我的日志UInt16指针,所以我可以看到它的稳定...但是到目前为止,我没有任何重要的,剂量任何人都知道如何做到这一点,我在想它的格式说明符,但是因为我没有很多的经验,我只是不知道这种类型的东西。我收到警告“指针目标类型的初始化丢弃限定”如何打印出UInt16指针到NSLog
//....
[nissanCode seekToFileOffset: 2];
dataBuffer = [nissanCode readDataOfLength:SETSIZE];
UInt16 *ans = dataBuffer.bytes;
UInt16 a = *ans;
NSLog (@"Data = %@", a);
//....
//修改后的代码,用于清除警告并打印数据输出的罚款。感谢帮助的人。
//....
[nissanCode seekToFileOffset: 2];
dataBuffer = [nissanCode readDataOfLength:SETSIZE];
const UInt16 *ans = dataBuffer.bytes;
NSLog (@"Data = %d", a);
//....
这一个完全在我匆忙但工作:) – tinhead 2011-06-15 03:09:16
使用!我仍然有警告.... – tinhead 2011-06-15 03:10:43
这里是[字符串格式说明符]的列表(http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html %23 // apple_ref/doc/uid/TP40004265)它可以用在'stringWithFormat:'和'NSLog'等等 – bshirley 2011-06-15 03:27:04