开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜