无法转换泛型类型

时间:2017-06-14 09:44:04

标签: swift syntax

为什么我会收到此错误?

  

无法转换FetchResultsController的类型<实体>预期   FetchedResultsController的参数类型< NSManagedObject>

protocol FetchedResultsControllerDelegate: class {
  func fetchedResultsControllerWillChangeContent(_ controller: FetchedResultsController<NSManagedObject>)
}

open class FetchedResultsController<Entity: NSManagedObject>: NSObject {

  weak var delegate: FetchedResultsControllerDelegate?

  func controllerWillChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) {
    delegate?.fetchedResultsControllerWillChangeContent(self) // here
  }

}

0 个答案:

没有答案