diff --git a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate index 03927c4f6ff207b0f6316ab6ac2e2c3138641c2a..ff460a772283e3809f2ef5ffa71d726cdb5ad530 100644 Binary files a/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate and b/openbis-ipad/openBIS/openBIS.xcodeproj/project.xcworkspace/xcuserdata/cramakri.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/openbis-ipad/openBIS/openBIS/CISDOBMasterViewController.h b/openbis-ipad/openBIS/openBIS/CISDOBMasterViewController.h index d970df5ca84637d9281fb610f0d076204affddb2..0a126623f07f5a134136bc80028a5a3e5ab4b1fe 100644 --- a/openbis-ipad/openBIS/openBIS/CISDOBMasterViewController.h +++ b/openbis-ipad/openBIS/openBIS/CISDOBMasterViewController.h @@ -32,6 +32,4 @@ @property (strong, nonatomic) CISDOBDetailViewController *detailViewController; @property (strong, nonatomic) CISDOBOpenBisModel *openBisModel; -@property (strong, nonatomic) NSFetchedResultsController *fetchedResultsController; - @end diff --git a/openbis-ipad/openBIS/openBIS/CISDOBMasterViewController.m b/openbis-ipad/openBIS/openBIS/CISDOBMasterViewController.m index cf5a12d9e7fc8f3fb0fb60ecec73b52c900eadce..b5b29cd41bccd5169a6e4d7a2cca253cb4bad4df 100644 --- a/openbis-ipad/openBIS/openBIS/CISDOBMasterViewController.m +++ b/openbis-ipad/openBIS/openBIS/CISDOBMasterViewController.m @@ -63,13 +63,13 @@ - (void)insertNewObject:(id)sender { - NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; + NSManagedObjectContext *context = [self.openBisModel.fetchedResultsController managedObjectContext]; // TODO Implement insert NSLog(@"Do not support adding new objects"); abort(); -// NSEntityDescription *entity = [[self.fetchedResultsController fetchRequest] entity]; +// NSEntityDescription *entity = [[self.openBisModel.fetchedResultsController fetchRequest] entity]; // NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; @@ -86,12 +86,12 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return [[self.fetchedResultsController sections] count]; + return [[self.openBisModel.fetchedResultsController sections] count]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { - id <NSFetchedResultsSectionInfo> sectionInfo = [self.fetchedResultsController sections][section]; + id <NSFetchedResultsSectionInfo> sectionInfo = [self.openBisModel.fetchedResultsController sections][section]; return [sectionInfo numberOfObjects]; } @@ -107,7 +107,7 @@ - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { - id <NSFetchedResultsSectionInfo> sectionInfo = [[self.fetchedResultsController sections] objectAtIndex: section]; + id <NSFetchedResultsSectionInfo> sectionInfo = [[self.openBisModel.fetchedResultsController sections] objectAtIndex: section]; NSArray *objects = [sectionInfo objects]; if ([objects count] < 1) return @""; @@ -122,8 +122,8 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { - NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext]; - [context deleteObject:[self.fetchedResultsController objectAtIndexPath:indexPath]]; + NSManagedObjectContext *context = [self.openBisModel.fetchedResultsController managedObjectContext]; + [context deleteObject:[self.openBisModel.fetchedResultsController objectAtIndexPath:indexPath]]; NSError *error = nil; if (![context save:&error]) { @@ -145,7 +145,7 @@ // Segue to the detail view unless we are on the ipad if ([[UIDevice currentDevice] userInterfaceIdiom] != UIUserInterfaceIdiomPad) return; - CISDOBIpadEntity *object = [self.fetchedResultsController objectAtIndexPath:indexPath]; + CISDOBIpadEntity *object = [self.openBisModel.fetchedResultsController objectAtIndexPath:indexPath]; if ([object.childrenPermIds count] > 0) { UIStoryboard *storyboard = self.storyboard; CISDOBMasterViewController *controller = [storyboard instantiateViewControllerWithIdentifier:@"Drill"]; @@ -164,14 +164,14 @@ { if ([[segue identifier] isEqualToString:@"showDetail"]) { NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; - CISDOBIpadEntity *object = [[self fetchedResultsController] objectAtIndexPath:indexPath]; + CISDOBIpadEntity *object = [self.openBisModel.fetchedResultsController objectAtIndexPath:indexPath]; [[segue destinationViewController] setDetailItem:object]; } } - (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath { - CISDOBIpadEntity *object = [self.fetchedResultsController objectAtIndexPath:indexPath]; + CISDOBIpadEntity *object = [self.openBisModel.fetchedResultsController objectAtIndexPath:indexPath]; cell.textLabel.text = [object valueForKey:@"summaryHeader"]; cell.detailTextLabel.text = [object valueForKey:@"summary"]; if ([object.childrenPermIds count] > 0) { @@ -183,11 +183,6 @@ #pragma mark - Fetched results controller -- (NSFetchedResultsController *)fetchedResultsController -{ - return self.openBisModel.fetchedResultsController; -} - - (void)controllerWillChangeContent:(NSFetchedResultsController *)controller { [self.tableView beginUpdates];