我正在尝试在iOS应用中使用Firebase。
我按照此处给出的说明安装了我需要的东西:
登录Firebase后立即Add Firebase to your iOS app
。
添加这些行:
@import UIKit;
@import Firebase;
(此时应用程序会继续编译并正常工作)
后来我按照这里给出的指示: https://firebase.google.com/docs/database/ 为了开始使用数据库。
现在是我遇到问题的时候;这一行:
@property (strong, nonatomic) FIRDatabaseReference *ref;
从编译器中收到此错误消息:
Unknown type name 'FIRDatabaseReference'
Property with 'retain (or strong)' attribute must be of object type
由于我只是遵循文档,我不太明白为什么这里的类型未知。 任何相关提示都非常有用。
答案 0 :(得分:1)
确保在项目工作区中安装了以下pod:
target 'FirebaseSDK' do
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
end
然后像
一样导入SDK#import <Firebase/Firebase.h>