我想为
IOS 11更新我的应用程序,并遇到此问题.这是我目前的代码:
protocol DataSourceDelegate: class { associatedtype Object func cellIdentifierForObject(object: Object) -> String func swipeToDeleteObject(object: Object) }
此协议用于我的一个视图控制器:
extension TransactionsViewController: DataSourceDelegate { func cellIdentifierForObject(object: Object) -> String { return "Cell" } func swipeToDeleteObject(object: Object) { object.managedObjectContext?.performChanges { object.managedObjectContext?.delete(object) } } }
现在我得到Object类型的这个错误:
‘Object’ is ambiguous for type lookup in this context
在这一行:
func cellIdentifierForObject(object: Object) -> String { ... }