Lldb error: using undeclared id

Does anyone know what is going on here:

@implementation Test { NSData *_data; } - (id)initWithData:(NSData *)data { self = [super init]; if (self) { _data = data; } return self; // BREAKPOINT HERE } 

From lldb:

 (lldb) p data (NSData *) $1 = 0x07f911e0 30308 bytes (lldb) p _data error: use of undeclared identifier '_data' error: 1 errors parsing expression 

Why can't I view _data ?

+2
source share
1 answer

I saw only data fields declared in the @interface block; you are apparently defining fields in @implementation .

Try putting this in the header, e.g.

 @interface Test { NSData *_data; } . . . @end 
-1
source

All Articles