ios format specifier: how to NSLog 0x%x in iOS 4.2
-
10-02-2021 - |
Pregunta
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?
Solución
I found the answer (with 30 characters) it's: %p
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow