任何人都知道这里发生了什么:
@implementation Test
{
NSData *_data;
}
- (id)initWithData:(NSData *)data
{
self = [super init];
if (self)
{
_data = data;
}
return self; // BREAKPOINT HERE
}
来自 lldb:
(lldb) p data
(NSData *) $1 = 0x07f911e0 30308 bytes
(lldb) p _data
error: use of undeclared identifier '_data'
error: 1 errors parsing expression
为什么我不能查看 _data
?
最佳答案
我只见过在@interface
block 中声明的数据字段;您似乎在 @implementation
中定义字段。
试着把它放在标题中,例如
@interface Test
{
NSData *_data;
}
. . .
@end
关于objective-c - 数据库错误 : use of undeclared identifier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11488361/