Reputation: 1115
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
Upvotes: 1
Views: 2196
Reputation: 31
Its simple, Just Add following line in your AppDelegate.h
@property (nonatomic, readonly, strong) FIRDatabaseReference * ref;// Property
After adding,In your AppDelegate.m didFinishLaunchingWithOption Replace
self.ref = [[FIRDatabase database] reference];
With
_ref = [[FIRDatabase database] reference];
Problem Solved.. :)
Upvotes: 3
Reputation: 1115
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];
Upvotes: 0