Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
出于记录和调试目的,我想打印一个对象的地址。当我仅按名称引用对象时,会自动推断描述方法,这是一个字符串。
有没有一种简单的方法来引用地址,作为一个数字?
要打印指针地址,请使用 %p 格式说明符:
NSLog(@"Pointer = %p", obj);