ios格式说明符:如何在iOS 4.2中使用NSLog 0x%x

时间:2011-10-21 17:58:00

标签: ios-4.2 nslog format-specifiers

 NSMutableArray *foo = [NSMutableArray arrayWithCapacity:12];
 NSLog(@" foo is 0x%x", foo);  // worked in XCode 4.0 to return the hex address of this variable     

现在它给出了编译器警告:

转换指定类型'unsigned int'但参数的类型为'NSMutableArray'

如何获得像“foo是0x53a6d0”这样的输出?

1 个答案:

答案 0 :(得分:0)

我找到了答案(有30个字符):%p