Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  2. {
  3. // Return the number of sections.
  4. return 1;
  5.  
  6. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  7. {
  8. // Return the number of rows in the section.
  9.  
  10. NSLog(@"Row count :%d",self.playerNames.count + 1);
  11. return self.playerNames.count + 1;
  12.  
  13. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  14. {
  15. static NSString *CellIdentifier = @"PlayerName";
  16. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  17. if (cell == nil) {
  18. cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
  19. }
  20.  
  21. if (indexPath.row < self.playerNames.count) {
  22. cell.textLabel.text = [self.playerNames objectAtIndex:indexPath.row];
  23. }
  24.  
  25. NSLog(@"Cell Text :%@",cell.textLabel.text);
  26. return cell;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement