I am sorting my tableview by Distributor using the code below (it was Alphabetical by product)
NSSortDescriptor *aSort =[[NSSortDescriptor alloc] initWithKey:@"Dis" ascending:YES];
[distribArray sortUsingDescriptors:[NSMutableArray arrayWithObject:aSort]];
NSLog( @"data from table %@", distribArray);
[self.tableView reloadData];
NSLog(@"ok2222222222");
[[NSUserDefaults standardUserDefaults] setValue:@"Dis" forKey:@"ListBy"];
[[NSUserDefaults standardUserDefaults] synchronize];
I would like to know what the easiest way to display the Distributor name as a Title header above all the products for that Distributor. I currently display the Distributor name in the DetailsView of the cell for each product.
I would like to go from.
Product 1
Acme
Product 2
Acme
Product 3
Acme
To this below and keep my UITableView\Cells
Acme
Product 1
Product 2
Product 3
.... Many Thanks for any help.