views:

53

answers:

2

Hi, I'm not seeing the text for my UITableView show up.. in fact the TableView doesn't appear to be on the screen at all because I cannot select the empty rows.

Strangely, my log in cellForRowAtIndexPath shows up ok with the expected data - I just don't see any on the screen.

 -(void)bindFriendsToTable:(NSArray *)friends{
NSLog(@"friends : %@",friends);
[sections removeAllObjects];
[sectionRows removeAllObjects];

[sections addObject:@"Friends"];
[sectionRows setObject:friends forKey:@"Friends"];  

[self.tableView reloadData];
HideActivityIndicator();

}

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *cellsection = [sections objectAtIndex:indexPath.section];
NSArray *rowsInSection = [sectionRows valueForKey:cellsection];

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}

cell.textLabel.font = [UIFont fontWithName:@"Helvetica" size:14];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone]; 
cell.textLabel.text = [rowsInSection objectAtIndex:indexPath.row];
NSLog(@"%@",cell.textLabel.text);

return cell;

}

I'm inheriting from a base class which is a UITableViewController, as I have for a dozen other screens in the project. Any idea why I'm not seeing the tableView?

+1  A: 

Is your font colour the same as your background colour? If you set the accessoryType to a checkmark does it display?

      cell.accessoryType = UITableViewCellAccessoryCheckmark;
Liam
Thanks for the response. Nope, I don't see the Accessory. I tried commenting out the selectionStyle stuff and cannot select the rows.
quantumpotato
+1  A: 

Do you have any header sections? If so make sure you return a value for heightForHeaderInSection:

-(float)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
      return 66;
}
Kevin W Lee
Forgot to set that! Thanks.
quantumpotato