Reputation: 416
I have iOS application which uses core data database and im using NSFetchedResultsController for populate a tableview. Im using entity named "Catalog" to populate tablview and i have thumbnail image stored in entity Named "Image" and i store image as NSData in a property of image entity, im updating that thumbnail image after populating the tableview but any of bellow methods not called.
(void)controllerDidChangeContent:(NSFetchedResultsController *)controller
But when i change a properties of "Catalog" entity itself those methods called.
Attributes
title <= String nid <= String (my primary key field) some few attributes
Relationship :thumbImage, Destination :Image, Inverse :catalog,
Attributes fid <= String (my primary key field), image <= Image Data field
Relationship :catalog, Destination :Catalog, Inverse :thumbImage
Upvotes: 0
Views: 1546
Reputation: 6011
try adding this to your Image
entity:
//Not tested
- (void) setImage:(NSData *)data
{
[self.catalog willChangeValueForKey:@"thumbImage"]
[self willChangeValueForKey:@"image"];
[self setPrimitiveValue:data forKey:@"image"];
[self didChangeValueForKey:@"image"];
[self.catalog didChangeValueForKey:@"thumbImage"];
}
Upvotes: 0