Say you have a core data entity,
public class CDPerson: NSManagedObject
You get new info from the net ... a field changes,
p.n
Core Data recognizes changes by the firing of -willChangeValueForKey:
and -didChangeValueForKey:
as the comment from @pbasdf indicated. You can call only -didChangeValueForKey:
if you want but I would really do both.
Those calls also work on relationships. So in your Address object, you can touch both the value to be changed and the relationship to the person:
- (void)setCity:(NSString*)cityString
{
[self willChangeValueForKey:@"city"];
[self willChangeValueForKey:@"person"];
_city = cityString;
[self didChangeValueForKey:@"person"];
[self didChangeValueForKey:@"city"];
}
With an end result of the NSFetchedResultsController
being told that the associated person object has changed and the cell should be re-drawn.