I recommend the following approach (not needing an array). for your numbers
-numberOfSectionsInTableView..{ return 1; } -numberOfRowsInSection..{ return a; } -cellForRowAtIndexPath..{ UITableViewCell* cell = ... UILabel *label = ... [label setText:[NSString stringWithFormat:@"%d",indexPath.row+1]]; [cell addSubView:label]; return cell; }
the result is a table with 1 section, rows, and each row will have a label from number 1 to a.
Sebastian
source share