Ios 客观C法&x27;控制器:didChangeObject:atIndexPath:forChangeType:newIndexPath
Objective-C方法“controller:didChangeObject:atIndexPath:forChangeType:newIndexPath:”由方法提供的“控制器(:didChangeObject:atIndexPath:forChangeType:newIndexPath:)”与协议“NSFetchedResultsControllerDelegate”中的可选要求方法“控制器(:didChangeObject:atIndexPath:forChangeType:newIndexPath:)”冲突Ios 客观C法&x27;控制器:didChangeObject:atIndexPath:forChangeType:newIndexPath,ios,swift,Ios,Swift,Objective-C方法“controller:didChangeObject:atIndexPath:forChangeType:newIndexPath:”由方法提供的“控制器(:didChangeObject:atIndexPath:forChangeType:newIndexPath:)”与协议“NSFetchedResultsControllerDelegate”中的可选要求方法“控制器(:didChangeObject:atIndexPath:forChangeType:newIn
看起来合适的方法签名是:
func controller(controller: NSFetchedResultsController, didChangeObject anObject: AnyObject, atIndexPath indexPath: NSIndexPath?, forChangeType type: NSFetchedResultsChangeType, newIndexPath: NSIndexPath?) {
}
任何解决这些问题的简单方法都是允许Xcode自动完成方法签名。然后,用自动生成的签名替换方法的签名。为此,定义方法时只需键入controller
,即可查看所有匹配方法的列表
func controller(controller: NSFetchedResultsController, didChangeObject anObject: AnyObject, atIndexPath indexPath: NSIndexPath?, forChangeType type: NSFetchedResultsChangeType, newIndexPath: NSIndexPath?) {
}