开发者

Can't set text label in table view in Xcode for the iPhone

I have this code:

tableList  = [[NSMutableArray alloc] initWithObje开发者_StackOverflow社区cts:@"First View",@"Second View",nil];

I have synthesized it and set the property, the problem is when I add this line under the configure the cell comment to set the text of each row, the app opens in the simulator but instantly closes:

// Configure the cell.
    cell.textLabel.text = [tableList objectAtIndex:indexPath.row];
return cell;

Any ideas on what is causing this ?


If you're getting an index: beyondBounds: crash, then you need to make sure that your table has no more rows than the tableList array has elements.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜