我会尽量做到尽可能的简单我是从核心数据使用NSFetchedResultsController我的cellForRowAtIndexPath看起来像这样核心数据+ NSFetchedResultsController在SWIFT
override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell? {
var cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell
let newEntry : Entry = fetchedResultController.objectAtIndexPath(indexPath) as Entry
cell.textLabel.text = newEntry.title
return cell
}
我的应用程序崩溃,
当我更换取下面
let newEntry : Entry = fetchedResultsController.objectAtIndexPath(indexPath) as Entry
符合该行的应用程序的工作记录填充tableview中没有错误没有问题
let newEntry : AnyObject! = self.fetchedResultsController.objectAtIndexPath(indexPath)
的问题是,为什么不AnyObject是一款入门NSManagedObject
谢谢
建议:两个问题应该写为SO两个独立的问题。 – andrewbuilder