在iOS Obj-C中何处添加Firebase数据库引用 [英] Where to add Firebase Database Reference in iOS Obj-C

查看:120
本文介绍了在iOS Obj-C中何处添加Firebase数据库引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过Firebase设置一个实时数据库,并且混淆了将以下代码行放在哪里:

  self .ref = [[FIRDatabase database] reference]; 

以下是我的说明: https://firebase.google.com/docs/database/ios/start



在我的应用程序委托下的(at)接口:

  @property FIRDatabaseReference * ref; 

然后,我可以在didFinishLaunchingWithOptions下添加以下内容:

  self.ref = [[FIRDatabase database] reference]; 


I'm setting up a realtime database through Firebase and am confused where to put the following line of code:

self.ref = [[FIRDatabase database] reference];

These are the instructions I'm following: https://firebase.google.com/docs/database/ios/start

解决方案

To address this, I added the following line under (at)interface in my App Delegate:

@property FIRDatabaseReference *ref;

Then I could add the following under didFinishLaunchingWithOptions:

self.ref = [[FIRDatabase database] reference];

这篇关于在iOS Obj-C中何处添加Firebase数据库引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆