ios 格式说明符:如何在 iOS 4.2 中 NSLog 0x%x
NSMutableArray *foo = [NSMutableArray arrayWithCapacity:12];
NSLog(@" foo is 0x%x", foo); // worked in XCode 4.0 to return the hex address of this variable
现在它给出编译器警告:
Conversion指定类型'unsigned int',但参数具有类型'NSMutableArray'
例如,如何获得像“foo is 0x53a6d0”这样的输出?
NSMutableArray *foo = [NSMutableArray arrayWithCapacity:12];
NSLog(@" foo is 0x%x", foo); // worked in XCode 4.0 to return the hex address of this variable
Now it gives compiler warning:
Conversion specifies type 'unsigned int' but the argument has type 'NSMutableArray'
How do I get output like "foo is 0x53a6d0" for example?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了答案(有 30 个字符):%p
I found the answer (with 30 characters) it's: %p