问题出在我的项目中。但我也在新的 xcode 草案项目中尝试了 Master-Detail Application 之一。
我创建了基本单元类并将单元映射到情节提要上。删除操作后 deinit 从未调用过。对单元格没有强或弱的任何引用。
class Cell:UITableViewCell {
deinit{
print("Deinit Called")
}
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! Cell
let object = objects[indexPath.row] as! NSDate
cell.textLabel!.text = object.description
return cell
}