Skip to content
Snippets Groups Projects
Commit 3fc979fa authored by cramakri's avatar cramakri
Browse files

Have sections working correctly

SVN: 27087
parent fefc07d6
No related branches found
No related tags found
No related merge requests found
......@@ -102,6 +102,14 @@
return cell;
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
if (0 == section) return @"Target";
if (1 == section) return @"Compound";
return @"";
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
return NO;
......@@ -162,14 +170,15 @@
[fetchRequest setFetchBatchSize:20];
// Edit the sort key as appropriate.
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"summaryHeader" ascending:NO];
NSArray *sortDescriptors = @[sortDescriptor];
NSSortDescriptor *entityTypeSortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"entityType" ascending:NO];
NSSortDescriptor *summaryHeaderSortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"summaryHeader" ascending:NO];
NSArray *sortDescriptors = @[entityTypeSortDescriptor, summaryHeaderSortDescriptor];
[fetchRequest setSortDescriptors:sortDescriptors];
// Edit the section name key path and cache name if appropriate.
// nil for section name key path means "no sections".
NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:nil cacheName:@"Master"];
NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest: fetchRequest managedObjectContext: self.managedObjectContext sectionNameKeyPath: @"entityType" cacheName: @"Master"];
aFetchedResultsController.delegate = self;
self.fetchedResultsController = aFetchedResultsController;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment