1
,我發現了錯誤:收到錯誤與populateCellWithBlock FirebaseUI
Cannot invoke 'populateCellWithBlock' with an argument list of type ((UITableViewCell, NSObject) -> Void)
我不知道爲什麼會這樣。任何建議都會很棒。謝謝。
self.dataSource.populateCellWithBlock { (cell: UITableViewCell, obj: NSObject) -> Void in
let snap = obj as! FDataSnapshot
cell.textLabel?.text = snap.value as? String
}
如果您使用的XCode 7測試版5+,與'__kindof'支持那麼原來應該工作(雖然,對於失去了我和文檔中沒有明確的理由,似乎這些類型的子類不工作,儘管他們在Obj-C中做);否則,如果沒有'__kindof'支持,類型默認爲'id'或'AnyObject'這就是David解決方案的原因。見https://github.com/firebase/FirebaseUI-iOS/blob/master/FirebaseUI/XCodeMacros.h#L58-L62關於這是如何實現的更多信息。 –