you need to create an array of arrays. the main array will represent the table partitions, while the internal arrays will be the contents of the partitions.
In numberOfSectionsInTableView put
return [mainArray count];
In cellForRowAtIndexPath :
NSMutableArray *tempDict = [mainArray objectAtIndex:indexPath.section]; NSArray *tempArray = [tempDict objectAtIndex:indexPath.row]; cell.textLabel.text = [NSString stringWithFormat:@"%@", [tempArray valueForKey:@"name"]]; cell.detailTextLabel.text = [NSString stringWithFormat:@"%@", [tempArray valueForKey:@"detail"]]; return cell;
ps The last object is an NSDictionary in my case, so I use valueForKey . Good luck
source share