對不起,我奇怪的問題FirebaseIOS:未聲明的類型「DatabaseReference」的使用
昨天我不得不更新我的火力吊艙,在此之前,一切都很好,但在那之後,我無法檢索數據了
因此,這裏是我的代碼
// let userID = FIRAuth.auth()?.currentUser?.uid
var rsef: DatabaseReference! // undeclared
rsef = Database.database().reference() //. undeclared
我讀了官方火力設置說明,這些是對的,但我不知道爲什麼它說未申報
˚F或參考,這是我完整的代碼
ref.child("KurdishRsta").child((FIRAuth.auth()?.currentUser?.uid)!).childByAutoId().queryOrderedByKey().observe(.childAdded, with:
{ (snapshot) in
print("Database\(String(describing: snapshot.value))")
let value = snapshot.value as? NSDictionary
let FullRsta1 = value?["Rsta"]
let FullMeaning1 = value?["Meaning"]
self.RetrivedRsta.insert(RstasFromFirebase(FullRsta:FullRsta1 as! String ,FullMeaning : FullMeaning1 as! String), at: 0)
self.tableview.reloadData()
})
}
的podfile
Target 'Dictionary' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
use_frameworks!
pod 'SDWebImage', '~>3.8'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'Firebase/Database'
# Pods for Dictionary
pod 'SVProgressHUD'
pod 'SKSplashView'
pod "FGTranslator"
pod 'SCLAlertView-Objective-C'
pod 'OneSignal'
pod 'Google/Analytics'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'Firebase/Database'
pod 'ChameleonFramework'
pod 'QMChatViewController'
pod 'ApiAI'
pod 'Firebase/RemoteConfig'
pod "ZHPopupView"
pod 'FCAlertView'
pod 'JSQMessagesViewController'
pod "CZPicker"
pod 'DTTJailbreakDetection'
pod 'MBProgressHUD', '~> 1.0.0'
pod 'PayPal-iOS-SDK'
您可以發佈您的pod文件並在您的代碼中導入Firebase嗎? –
@GabrielDiez ofcourse,我已編輯我的帖子 –
當您從命令行運行'pod過時'時會發生什麼?也許由於某種原因,如果它位於Podfile.lock文件中,它會拉動較老的依賴項。實際上,您可以檢查的另一種方式是,如果您將「DatabaseReference」替換爲「FIRDatabaseReference」,並且如果可行,則由於某種原因,它會將過時的容器拉出來。 –