我有一个表格视图,我需要以某种方式保存之前检查过的那些。我已经保存了那些在数组中检查的索引路径。现在我有下面的代码,我不知道如何定义“单元格”(项目是 NSindexpath )。我已经尝试过了,但它返回 nill 并且不起作用:let cell = super.tableView.cellForRowAtIndexPath(items)
override func viewWillAppear(animated: Bool) {
for items in indexpatharray{
if !indexpatharray.isEmpty{
let cell =
cell!.accessoryType = UITableViewCellAccessoryType.Checkmark;
cell!.selectionStyle = .None
}
我已经尝试过了,但它返回 nill 并且不起作用:let cell = super.tableView.cellForRowAtIndexPath(items)