有谁知道如何在 IOS 中获取类成员变量的值?
我尝试使用 LLDB 在类成员变量中调试 NSArray。
在我运行这个之后
__cellDataShadowArray2D = [[NSArray alloc] initWithObjects:[NSArray arrayWithObjects:obj1, obj2, nil], nil];
当我使用 LLDB(打印对象)检查值时,我总是得到这个。
(lldb) po __cellDataShadowArray2D
(NSArray *) $66 = 0x001e8894 <object returned empty description>
(lldb) p __cellDataShadowArray2D
(NSArray *) $67 = 0x001e8894
(lldb) po [__cellDataShadowArray2D count]
2012-04-24 10:10:38.535 SOME [61985:15803] -[__NSCFConstantString count]: unrecognized selector sent to instance 0x1e8894
(id) $68 = 0x00000000 <nil>
(lldb) po [__cellDataShadowArray2D retainCount]
(id) $69 = 0xffffffff [no Objective-C description available]
(lldb) p (int) [__cellDataShadowArray2D retainCount]
(int) $70 = -1
(lldb) p (int) [__cellDataShadowArray2D count]
2012-04-24 10:11:31.333 SOME [61985:15803] -[__NSCFConstantString count]: unrecognized selector sent to instance 0x1e8894
(int) $71 = 0