我有一个视图控制器,单击按钮时显示一个表视图控制器。一切工作正常表视图委托,表视图显示很好,但在ellForRowAtIndexPath:委托方法,单元格被实例化并返回,但它没有正确显示。表视图不显示自定义单元格
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"alrededor";
alrededorCell *cell = [tableView
dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[alrededorCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
NSDictionary *categoria = [[NSDictionary alloc] initWithDictionary: [_categoriasArray objectAtIndex:indexPath.row]];
NSLog(@"categoria %@", categoria);
cell.title.text = [categoria valueForKey:@"title"];
return cell;
}
非常感谢
你是什么意思**无法正确显示**? – 2012-04-19 11:00:37