title: Serious Application Error in Core Data with fetchedResultsContainer
body: <p>I get the following error when trying to add a record:</p>
  
  <blockquote>
    <p>Serious application error.  Exception
    was caught during Core Data change
    processing.  This is usually a bug
    within an observer of
    NSManagedObjectContextObjectsDidChangeNotification.
    The index 0 is invalid with userInfo
    (null)</p>
  </blockquote>
  
  <p>And that's it. I put breakpoints into all the fetchedResultsContainer delegate methods I have implemented, but nothing breaks.</p>
  
  <p>I tracked it down to:</p>
  
  <pre><code>  NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:@"titleFirstLetter" cacheName:@"Root"];
  </code></pre>
  
  <p>"sectionNameKeyPath" is the problem. "titleFirstLetter" is a transient property that I created a getter for in my NSManagedObject subclass. </p>
  
  <p>Here's the getter:</p>
  
  <pre><code>-(NSString *)titleFirstLetter
  {
    [self willAccessValueForKey:@"titleFirstLetter"];
    NSString *aString = [[self valueForKey:@"title"] uppercaseString];
  
    NSString *stringToReturn = [aString substringWithRange:[aString rangeOfComposedCharacterSequenceAtIndex:0]];
  
    [self didAccessValueForKey:@"titleFirstLetter"];
    return stringToReturn;
  }
  </code></pre>
  
  <p>When I change the sectionNameKeyPath to nil, it works, but is obviously not what I want. It also works when I have a title already filled in for my model, so that titleFirstLetter doesn't return nil, though that doesn't seem to be quite the problem. If I make the string something arbitrary if it's nil, it still crashes.</p>
  
  <p>Any idea what's up here?</p>
  
  <p>UPDATE:
  If I use the title in the sectionNameKeyPath instead of the transient property, it doesn't crash, but obviously puts every item in its own section. So it's somehow related to the transient property...</p>
  
  <p>UPDATE2:
  Some preliminary hacking with using a persistent property instead of transient, and no other changes, seems to work just fine, so this looks to be a bug. I have a bug report open: #8553064</p>
  
  <p>UPDATE3:
  Well, scratch that. Using a persistent attribute didn't make any difference. I am somewhat at whits end now.</p>
  
  <p>Thanks!</p>