IOS - How to update / update Core Data Transfer property?

I am using NSFetchedResultsController UITableView master data with transition attribute NSDate. The main reason I have this transient property is because my UITableView entries are placed in sections based on NSDate, but can move between sections when the date changes.

So far, this works fine, but it only updates / updates (I'm really new to this, so I don't know if I use the correct terminology, sorry!) When I either close the application and kill it from multitasking or restart it through Xcode. If I do not, the elements will not change and will not be placed in the correct sections. Is there a way to manually update it so that the user does not need to do this to make it work correctly?

Thank!

+5
source share
2 answers

Transient properties are updated when sent refreshObject:mergeChanges:to your object.

, Mundi , , , , .

+3

, , transient sectionNameKeyPath . - sectionIdentifier ( Apple ). . ( dateAttribute.

, , Entity.m:

+ (NSSet *)keyPathsForValuesAffectingSectionIdentifier {
    // If the value of dateAttribute changes, the section identifier may change as well.
    return [NSSet setWithObject:@"dateAttribute"];
}

, ,

- (void)controllerDidChangeContent:(NSFetchedResultsController *)controller
{
   if (!self.tableView.editing) [self.tableView reloadData];
   // the quick and dirty method without animations;
   // see referenced code for a more pleasant approach
}

- , Apple DateSectionTitles.

+7

All Articles