When debugging, I need to check the value of a private NSString member, named str for example. After:
self.str = xxxxxxx;
I typed "po self.str" in the console but only got "(NSString *) $37 = 0x00000000 "
So I tried:
NSLog("%@", self.str);
…then I saw the string value.
Why can’t I check the value of var using the command "po"?
Now I know it is because that I was using lldb as the debugger, as opposed to gdb. So the "po" (print-object) command can only display the address of pointer. Is there any solution about print an object's description while using lldb?
update: I find self
itself is not available. I guess the problem has connection with the class instance, which is a static variable. Is that the reason po
cannot find the pointer of self
?