self.clearsSelectionOnViewWillAppear将无法编译

时间:2010-04-08 19:37:56

标签: iphone cocoa-touch

这段代码附带了新类,它们是UITableViewController ...

的子类
- (void)viewDidLoad {
    [super viewDidLoad];

    // Uncomment the following line to preserve selection between presentations.
    self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

但是,取消注释clearsSelectionOnViewWillAppear会抛出编译错误。错误是“请求成员'clearsSelectionOnViewWillAppear'在非结构或联合的东西中”。关于为什么或你有解决方法的任何想法?

我甚至关心的原因是因为没有这一点,我的应用程序将离开选择指示器(蓝色背景)在我的表格单元格上。

1 个答案:

答案 0 :(得分:4)

您是在编译3.1.3(或更早版本)还是3.2? clearsSelectionOnViewWillAppear是3.2及更新版SDK中提供的属性。

相关问题