How do I capture the address of an object at a certain point in my code? for example:
NSString * aString = @"bla bla";
//what is the current address of aString. i.e to which address in memory does it currently point to
aString = @"la la la";
//what is the current address of aString.
Example:
NSString *temp = @"123";
uintptr_t ptrAddress = (uintptr_t) temp;
NSLog(@"%@ %p %lu", temp, temp, ptrAddress);
Console:
2013-07-11 11:51:20.796 asd[6474:907] 123 0x17985c 1546332
It may also be useful for you - NSPointerArray (iOS 6+)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With