سؤال

Usually in the lldb debugger, if you do a po on an object its address is also shown along with the description. However, in case of a NSString the address is not shown. So the question is that is there a way to see it.

PS - NSLog %p in source code is not the answer I am looking for.

هل كانت مفيدة؟

المحلول

Simple use "p" in place of "po".

Example:

NSString *string1 = @"test 1";
NSString *string2 = @"test 2";

(lldb) po string1
test 1
(lldb) p string1
(NSString *) $2 = 0x0000000100003af0 @"test 1"
(lldb) p string2
(NSString *) $3 = 0x0000000100003b10 @"test 2"

نصائح أخرى

You can use register read to read the address in memory. it will log like eax = 0x00004940 @"string"and with other register address and description.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top