title: NSFetchedResultsController for new object
body: <p>I have UITableViewController with static editable cells. In my UITableViewController I make CoreData object, like this:</p>
  
  <pre><code>- (User*)user {
      if (_user == nil) {
          _user = [NSEntityDescription insertNewObjectForEntityForName:TABLE_USER inManagedObjectContext:self.managedObjectContext];
          NSError* error;
          [self.managedObjectContext save:&amp;error];
          if (error != nil) {
              abort();
          }
      }
      return _user;
  }
  </code></pre>
  
  <p>I want to get the object in NSFetchedResultsController that would display its fields in a table, and then save the object.
  I'm trying to do:</p>
  
  <pre><code>- (NSFetchedResultsController *)fetchedResultsController
  {
      if (_fetchedResultsController != nil) {
          return _fetchedResultsController;
      }
  
      NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
      // Edit the entity name as appropriate.
      NSEntityDescription *entity = [NSEntityDescription entityForName:TABLE_USER_PROFILE inManagedObjectContext:self.managedObjectContext];
      [fetchRequest setEntity:entity];
  
      // Set the batch size to a suitable number.
      [fetchRequest setFetchBatchSize:20];
  
      NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"lastName" ascending:NO];
      NSArray *sortDescriptors = @[sortDescriptor];
  
  
      NSPredicate* pred = [NSPredicate predicateWithFormat:@"%@ = %@", TABLE_USER, self.user];
      [fetchRequest setPredicate:pred];
  
      [fetchRequest setSortDescriptors:sortDescriptors];
  
      NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:nil cacheName:TABLE_USER];
      aFetchedResultsController.delegate = self;
      self.fetchedResultsController = aFetchedResultsController;
  
      NSError *error = nil;
      if (![self.fetchedResultsController performFetch:&amp;error]) {
          abort();
      }
  
      return _fetchedResultsController;
  }
  </code></pre>
  
  <p>But it didn't work. I get empty fetchedResultsController. </p>