views:

10

answers:

0

Hi guys!

Currently I'm receiving a list of objects from a SQLiteDB by using:

-(NSMutableArray*) getMoreForObjectIdByCategoryId:(NSInteger) itemId: (NSInteger) categoryId 

On the ViewController Side, I'm using the

(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

in combination with my model:

RecordElement *nz = (RecordElement *)[objectsExt objectAtIndex:indexPath.row]; 
cell.textLabel.text = [NSString stringWithFormat:@"%@",nz.elementName];

This is working quite well for me - but i want to extend the TableView by a grouping of the cells by the category of the Element in the DB. The category is stored within my model RecordElement as a NSString.

What would be the best way to seperate the cells by sections?

I thought about using an NSDictionary and for each key(=the category), the value is an NSArray of RecordElement Models ... but I thought there might be a easier / given solution for my problem!

Thanks for any suggestion! Let me know if you need more info!