【发布时间】:2012-08-28 11:28:25
【问题描述】:
我想在类扩展中为 UITableView 添加一个属性:
@interface UITableViewController ()
@property NSString *entityString;
@end
然后我导入扩展,然后在 UITableViewController 的子类中使用 entityString 属性:
@implementation CustomerTableViewController
- (void)viewDidLoad {
self.entityString = @"Customer";
...
[super viewDidLoad];
}
...
编译器会自动合成相关的访问器 主类中的方法(...) 实施。
但是当我尝试执行它时,我得到了这个错误:
-[CustomerTableViewController setEntityString:]:无法识别的选择器发送到实例 0x737b670
我做错了什么?也许子类无法访问该属性?
【问题讨论】:
标签: objective-c automatic-ref-counting ios5.1