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];
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.. :)
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];