如何在swift中获取获取对象?

如何在swift中获取获取对象?,swift,ios8,Swift,Ios8,我试着用这个: func configureCell(cell: UITableViewCell, atIndexPath indexPath: NSIndexPath){ let task = tasks.fetchedObject[indexPath.row] as Task cell.textLabel?.text = task.n } 但在我的“let task”中,我收到了以下错误: “NSFetchedResultsController没有名为'fetchedObj

我试着用这个:

func configureCell(cell: UITableViewCell, atIndexPath indexPath: NSIndexPath){
    let task = tasks.fetchedObject[indexPath.row] as Task
    cell.textLabel?.text = task.n
}
但在我的“let task”中,我收到了以下错误:

“NSFetchedResultsController没有名为'fetchedObject'的成员”


我可以用什么来代替fetchedObject?

一旦有了fetchedObject,就可以通过查找对象中的键/值对来设置单元格标题,attributeName应该与.xcdatamodeld文件中列出的属性名称完全匹配

let task = tasks.fetchedObject[indexPath.row]
cell.textLabel?.text = task.valueForKey("attibuteName") as? String

试试这个。将task=self.fetchedResultsController.objectAtIndexPath(indexPath.row)设为task此返回错误:viewController没有名为“fetchedResultsController”的成员,但我尚未实现该委托