I have a Core Data in my application. One of the entity is Details
. Details
have 2 attributes named guid
and the other is details
. Both attributes contain a lot of values. At the point of fetching, I have to take the details
of the corresponding guid
. Can I get the values that saved in the other attribute with the guid? How can I connect these two attributes? This is how I am saving values to 2 attributes.
ReaderAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
NSManagedObjectContext *context = [appDelegate managedObjectContext];
NSManagedObject *object;
object = [NSEntityDescription insertNewObjectForEntityForName:@"Details" inManagedObjectContext:context];
[object setValue: [[activity objectForKey:@"category_guid"]stringValue]forKey:@"guid"];
[object setValue:[activity objectForKey:@"details"] forKey:@"details"];
NSError *error;
if (![context save:&error]) {
NSLog(@"Error save base");
}
else {
NSLog(@"saved");
}