我有一个UITableView工作得很好。当启用使用viewDidLoad中的内部下面的代码编辑模式()方法:Swift UIViewController UITableView编辑模式导致tableView部分返回无
self.tableView.editing = true
我收到以下错误:
fatal error: unexpectedly found nil while unwrapping an Optional value
在这条线:
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return fetchedResultsController.sections!.count // error here
}
我检查, fetchedResultsController不是零,但部分是。
如果编辑模式被禁用,情况并非如此。
可能是什么原因?
太棒了,现在解决了我的问题。你对你的假设可能是正确的。我现在将其标记为正确。 – Sev 2014-10-04 01:33:03