我没有看到我的UITableView显示的文本..实际上,TableView并没有出现在屏幕上,因为我无法选择空行。UITableView单元格文本没有显示?
奇怪的是,我在cellForRowAtIndexPath中的日志显示了预期的数据 - 我只是在屏幕上看不到任何内容。
-(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;
}
我从一个基类,它是一个UITableViewController,因为我有项目等十多种屏幕继承。任何想法,为什么我没有看到tableView?
忘了设置!谢谢。 – quantumpotato 2010-09-30 19:42:36