テーブルビューがあり、以前にチェックしたものを何らかの方法で保存する必要があります。チェックインされたもののインデックスパスを配列に保存しました。今、私は以下のコードを持っていますが、「セル」を定義する方法がわかりません(項目は 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)