title: Retrieve data from firebase database and show in UITable in Objective-C
body: <p>I have the following database in the Firebase,
  <a href="https://i.stack.imgur.com/7u6b4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7u6b4.png" alt="enter image description here"></a></p>
  
  <p>I am trying to retrieve data and show them in the UITable view. First I want to retrieve agreements from database. For now there is only one record for agreements but there going to be many records in the future. I tried the below code </p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
  
      // Uncomment the following line to preserve selection between presentations.
      //self.clearsSelectionOnViewWillAppear = NO;
  
      [[_firebaseDatabaseRef child:@"krib-60229"] observeEventType:FIRDataEventTypeValue withBlock:^(FIRDataSnapshot *_Nonnull snapshot){
          self.allSnapshot = [NSMutableArray array];
          NSLog(@"%@",self.allSnapshot);
          NSLog(@"%s","TestTestTest");
          for(snapshot in snapshot.children){
              [self.allSnapshot addObject:snapshot];
          }
          [self.tableView reloadData];
      }];
  }
  
  #pragma mark - Table view data source
  
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
      return 3;
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
      return [self.allSnapshot count];
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
      FIRDataSnapshot *snapShot = [self.allSnapshot objectAtIndex:indexPath.row];
  
      NSString *testText = snapShot.value[@"landlordDisplayName"];
  
      cell.textLabel.text = testText;
  
      // Configure the cell...
  
      return cell;
  }
  </code></pre>
  
  <p>I don't get anything retrieved or any error either. I tried putting NSLogs, but they are also not printing.</p>