I have two entities in coredata:
Voice described like:
NSString *code
NSString *description
and
Movement described like:
NSDate *date
NSString *notes
Voice *voice
I need to write down something like this (and i must use a generic NSManagedObject and NSObject)
NSManagedObject *currentManagedObject = [fetchedController objectAtIndexPath:indexPath];
NSObject *value = [currentManagedObject valueForKey:@"voice.description"];
The fetch is executed over a list of Movement entities.
But when I execute the code I receive this error:
012-02-09 01:52:15.843 MyApplication[1846:707] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Movement 0x16e680> valueForUndefinedKey:]: the entity Movement is not key value coding-compliant for the key "voice.description".
Is there a way to solve this issue using a generic access?
i’ve just solved the problem changing valueForKey method with valuerForKeyPath method.
Thank you