开发者

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

开发者 https://www.devze.com 2022-12-24 09:34 出处:网络
I have this code: tableList= [[NSMutableArray alloc] initWithObje开发者_StackOverflow社区cts:@\"First View\",@\"Second View\",nil];

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

精彩评论

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