如何解决使用未解析的标识符"设置选项"?



>我已经将Firestore更新为以下内容。现在,我不能再使用它了。我删除了,重新安装了几次。但是没有变化。我正在失去理智。问题是:

"使用未解析的标识符'设置选项'"。

db.collection("").document("").setData([ "p1answered":false, "p1OutofTime": false ], options: SetOptions.merge())
Bolts (1.9.0)
Using BoringSSL (10.0.2)
Using FBSDKCoreKit (4.33.0)
Using FBSDKLoginKit (4.33.0)
Using Firebase (5.0.1)
Using FirebaseAnalytics (5.0.0)
Using FirebaseAuth (5.0.0)
Using FirebaseCore (5.0.1)
Using FirebaseFirestore (0.12.1)
Using FirebaseInstanceID (3.0.0)
Using FirebaseUI (5.0.0)
Using GTMOAuth2 (1.1.6)
Using GTMSessionFetcher (1.1.15)
Using Google-Mobile-Ads-SDK (7.31.0)
Using GoogleSignIn (4.1.2)
Using GoogleToolboxForMac (2.1.4)
Using Protobuf (3.5.0)
Using SwiftySound (1.0.0)
Using TwitterCore (3.1.0)
Using TwitterKit (3.3.0)
Using gRPC (1.12.0)
Using gRPC-Core (1.12.0)
Using gRPC-ProtoRPC (1.12.0)
Using gRPC-RxLibrary (1.12.0)
Using leveldb-library (1.20)
Using nanopb (0.3.8)

//pod 文件

取消下一行注释,为项目定义全局平台

平台:iOS,'9.0'

目标"塔赫明等人"做 # 如果您不使用 Swift 并且不想使用动态框架,请注释下一行 use_frameworks!

# Pods for My App
pod 'SwiftySound'
pod 'FirebaseUI/Google'
pod 'FirebaseUI/Facebook'
pod 'Google-Mobile-Ads-SDK'
pod 'FirebaseUI/Twitter'
pod 'FirebaseCore'
pod 'FirebaseAuth'
pod 'FirebaseFirestore'
end

你的代码没问题,你只需要在你的类中import FirebaseFirestore

编辑:讨论后

pod 'FirebaseFirestore'也是不正确的。应该是pod 'Firebase/Firestore'.请查看 Firebase 入门指南,选择">设置开发环境"下的"iOS"选项卡。

编辑: 2

在最新的文档中,它是这样的:

db.collection("cities").document("BJ").setData([ "capital": true ], merge: true)

最新更新