title: How to appropriately performFetch from NSFetchedResultsController after changes in another context?
body: <p>When I make some changes in another top layer controller with own context then I post notification to UITableViewController class for update cells. This notification calls performFetch after setting fetchedResultsController to nil. But I have seen this changes only if I reload UITableViewController entirely. I'm not using cache.
  How to refresh tableView cells immediately after updating my PersistentStore?</p>
  
  <pre><code>- (void)performFetch {
      NSError *error = nil;
  
      _fetchedResultsController = nil;
      if (![self.fetchedResultsController performFetch:&amp;error]) {
      NSLog(@"Unable to perform fetch. Reason: %@", [error localizedDescription]);
      }
      [self.tableView reloadData];
  }
  
  
  - (NSFetchedResultsController *)fetchedResultsController {
      if (_fetchedResultsController) {
          return _fetchedResultsController;
      } else {
          NSFetchRequest *request = [[NSFetchRequest alloc] init];
          NSEntityDescription *entity = [NSEntityDescription entityForName:@"Item" inManagedObjectContext:self.managedObjectContext];
          NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"orderingValue" ascending:YES];
          [request setSortDescriptors:@[sort]];
          NSPredicate *predicate = [NSPredicate predicateWithFormat:@"syncStatus != %d", ObjectDeleted];
          [request setEntity:entity];
          [request setFetchBatchSize:20];
          [request setPredicate:predicate];
  
          NSFetchedResultsController *fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request managedObjectContext:self.managedObjectContext sectionNameKeyPath:nil cacheName:nil];
          _fetchedResultsController = fetchedResultsController;
          _fetchedResultsController.delegate = self;
      }
  
      return _fetchedResultsController;
  }
  </code></pre>
  
  <p><strong>UPDATED:</strong>
  This is FetchedResultsController Delegate method:</p>
  
  <pre><code>- (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath {
  
      UITableView *tableView = self.tableView;
  
      switch(type) {
  
          case NSFetchedResultsChangeInsert:
              [tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade];
              break;
  
          case NSFetchedResultsChangeDelete:
              [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
              break;
  
          case NSFetchedResultsChangeUpdate:
              [self configureCell:(ItemCell *)[tableView cellForRowAtIndexPath:indexPath] atIndexPath:indexPath];
              break;
  
          case NSFetchedResultsChangeMove:
              break;
      }
  }
  </code></pre>
  
  <p>Context of UITableViewController:</p>
  
  <pre><code>self.managedObjectContext = [[CoreDataController sharedInstance] newManagedObjectContext];
  </code></pre>
  
  <p>Context of DetailsViewController:</p>
  
  <pre><code>self.managedObjectContext = [[CoreDataController sharedInstance] masterManagedObjectContext];
  </code></pre>
  
  <p>CoreDataController:</p>
  
  <pre><code>- (NSManagedObjectContext *)masterManagedObjectContext {
      if (_masterManagedObjectContext != nil) {
          return _masterManagedObjectContext;
      }
  
      NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
      if (coordinator != nil) {
          _masterManagedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
          [_masterManagedObjectContext performBlockAndWait:^{
              [_masterManagedObjectContext setPersistentStoreCoordinator:coordinator];
          }];
  
      }
      return _masterManagedObjectContext;
  }
  
  - (NSManagedObjectContext *)newManagedObjectContext {
      NSManagedObjectContext *newContext = nil;
      NSManagedObjectContext *masterContext = [self masterManagedObjectContext];
      if (masterContext != nil) {
          newContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
          [newContext performBlockAndWait:^{
              [newContext setParentContext:masterContext]; 
          }];
      }
  
      return newContext;
  }
  </code></pre>