title: NSFetchedResultsController doesn't update UITableView after launch
body: <p>I have a simple UIManagedDocument-based Core Data app.  I'm new to programming in iOS and I've barely got it off the ground and I'm stuck.  I have People NSManagedObjects stored in Core Data.  When I first launch the app, no entries are there, but if I slide up a modal VC and dismiss it, they magically appear.  My design is loosely based on the "Photomania" app from the iTunes U/Sanford course, but with a singleton CoreDataStore object to handle getting the managedObjectContext.  This is the code for my CoreDataStore:</p>
  
  <pre><code>+ (CoreDataStore *)sharedStore
  {
      static CoreDataStore *sharedStore = nil;
      if (!sharedStore)
          sharedStore = [[super allocWithZone:nil] init];
  
      return sharedStore;
  }
  
  + (instancetype)allocWithZone:(struct _NSZone *)zone
  {
      return [self sharedStore];
  }
  
  - (NSManagedObjectContext *)getContext
  {
      NSURL *url = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory
                                                           inDomains:NSUserDomainMask] lastObject];
      url = [url URLByAppendingPathComponent:@"dbDocument"];
      UIManagedDocument *document = [[UIManagedDocument alloc] initWithFileURL:url];
  
      if (![[NSFileManager defaultManager] fileExistsAtPath:[url path]]) {
          NSLog(@"No file exists...");
          [document saveToURL:url forSaveOperation:UIDocumentSaveForCreating completionHandler:^(BOOL success) {
              NSLog(@"Document saveForCreating completionHandler invoked. Success: %hhd", success);
              if (success) {
                  self.managedObjectContext = document.managedObjectContext;
                  NSLog(@"Got context for created file!!");
              }
          }];
      } else if (document.documentState == UIDocumentStateClosed) {
          NSLog(@"Document state is closed. documentState == %u", document.documentState);
          [document openWithCompletionHandler:^(BOOL success) {
              NSLog(@"Document opening success: %hhd", success);
              if (success) {
                  self.managedObjectContext = document.managedObjectContext;
                  NSLog(@"Got context for now-opened file!!");
              }
          }];
      } else {
          self.managedObjectContext = document.managedObjectContext;
          NSLog(@"Got context for already-opened file!!");
      }
  
      return self.managedObjectContext;
  }
  </code></pre>
  
  <p>And here is the code from the PeopleListViewController:</p>
  
  <pre><code>- (void)setManagedObjectContext:(NSManagedObjectContext *)managedObjectContext
  {
      _managedObjectContext = managedObjectContext;
      if (managedObjectContext) {
          NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Person"];
          request.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"name"
                                          ascending:YES
                                          selector:@selector(localizedCaseInsensitiveCompare:)]];
          request.predicate = nil;  // all Persons
          self.fetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request managedObjectContext:managedObjectContext sectionNameKeyPath:nil cacheName:nil];
      } else {
          self.fetchedResultsController = nil;
      }
  }
  
  - (void)viewWillAppear:(BOOL)animated
  {
      [super viewWillAppear:animated];
      if (!self.managedObjectContext)
          [self setManagedObjectContext:[[CoreDataStore sharedStore] getContext]];
  }
  </code></pre>
  
  <p>This is the result immediately after launch:</p>
  
  <p><img src="https://i.stack.imgur.com/NgnkT.png" alt="After launch"></p>
  
  <p>This is the modal VC:</p>
  
  <p><img src="https://i.stack.imgur.com/HGUW2.png" alt="Modal VC"></p>
  
  <p>This is after dismissing the modal VC (tapped Cancel):</p>
  
  <p><img src="https://i.stack.imgur.com/HRVLU.png" alt="After Modal"></p>
  
  <p>I've tried using performFetch on the managedObjectContext, even delaying it until well after the Core Data document reported it was opened.  Nothing works.  Any help would be greatly appreciated.</p>