Objective-C >> Capturing an Object Address in Memory -


how capture address of object @ point in code? example:

nsstring * astring = @"bla bla"; //what current address of astring. i.e address in memory point astring = @"la la la"; //what 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 useful - nspointerarray (ios 6+)


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -