Note that there are some explanatory texts on larger screens.

plurals
  1. POChanged sectionNameKeyPath attribute value is not reflected on NSFetchedResultsController
    primarykey
    data
    text
    <p>I have a table-view backed by an NSFetchedResultsController.</p> <p>Any time an object in the underlying context changes, the NSFetchedResultsController automatically reflects new attribute values on the table-view. Yay.</p> <p>The one exception I have noticed is that updates to the attribute value used for sectionNameKeyPath are not reflected automatically.</p> <p>I'm guessing the attribute value used for the sectionNameKeyPath is so fundamental to the NSFetchedResultsController that I'll need to performFetch &amp; reload the table-view again?</p> <p><strong>Update</strong>: heres the code used to configure the fetch request</p> <pre><code>- (void)configureFetch { CoreDataHelper *cdh = [(AppDelegate *)[[UIApplication sharedApplication] delegate] cdh]; NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Item"]; request.sortDescriptors = [NSArray arrayWithObjects: [NSSortDescriptor sortDescriptorWithKey:@"locationAtHome.storedIn" ascending:YES], [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES], nil]; [request setFetchBatchSize:15]; self.frc = [[NSFetchedResultsController alloc] initWithFetchRequest:request managedObjectContext:cdh.context sectionNameKeyPath:@"locationAtHome.storedIn" cacheName:nil]; self.frc.delegate = self; } </code></pre> <p>and the code to perform the fetch:</p> <pre><code>- (void)performFetch { if (self.frc) { [self.frc.managedObjectContext performBlockAndWait:^{ NSError *error; [self.frc performFetch:&amp;error]; if (error) NSLog(@"%@ '%@' %@ (Reason: %@)", self.class, NSStringFromSelector(_cmd), error.localizedDescription, error.localizedFailureReason); [self.tableView reloadData]; }]; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload