UITableView Cell Dynamic Array not Loading
Please help me figure out why the first line does not print the cell text while the second one does:
cell.textLabel.text = [NSString stringWithFormat:@"Hello %@", [swaItems objectAtIndex:indexPath.row]];
cell.t开发者_Go百科extLabel.text = @"Hello";
No error is generated at any time.
Where you want the cell to initialize :
NSArray *swaItems = [[NSArray alloc] initWithObjects:@"1", @"2", @"3", nil];
NSString *string = [swaItems objectAtIndex:indexPath];
NSLog(@"%@", string);
cell.textLabel.text = string;
Works for me.
精彩评论