I have populated a tableview with an array of arrays, but I do not know how to display text as the cell label.
I want to use the string in the "0" position of the array that is inside the array as the text label.
Thanks.
Here's my code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
// Set up the cell...
cell.textLabel.text = [excersizeArray objectAtIndex:indexPath.row];
return cell;
}
You need to access the array within the array since you have an array of arrays:
This get's the array at index
indexPath.row
(the table's row) fromexercisesArray
.This get's the string (as you implied) from that array (the inner array).