2012-02-09 43 views
0

我在coredata两个实体:Coredata访问构件与KVC符号的关系

语音描述,如:

NSString *code 

NSString *description 

运动描述,如:

NSDate *date 

NSString *notes 

Voice *voice 

我需要写下这样的东西(我必须使用通用的NSManagedObj ect和NSObject)

NSManagedObject *currentManagedObject = [fetchedController objectAtIndexPath:indexPath]; 

NSObject *value = [currentManagedObject valueForKey:@"voice.description"]; 

通过移动实体列表执行提取。

但是,当我执行的代码我收到此错误:

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". 

有没有使用通用接入解决这个问题的方法吗?

回答

2

我刚刚通过valuerForKeyPath方法解决了改变valueForKey方法的问题。

谢谢