我正在使用RestKit-0.20.3并遇到问题 我在数据库中有一个Student表。为了获得学生历史记录,请执行api调用,像这样https://xyz.com/api/getStudentHistory?x=a&y=b&z=c的网址带有一些参数。 使用这种方法
[[RKObjectManager sharedManager] getObjectsAtPath:path parameters:param success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult)
在'路径'参数中传递路径= https://xyz.com/api/getStudentHistory
服务器发送响应时出现此错误。
CoreData: error: Failed to call designated initializer on NSManagedObject class ’Student’
之后我收到此消息并且应用程序崩溃。
Uncaught exception [<Student 0xd36b3e0> valueForUndefinedKey:]: the entity (null) is not key value coding-compliant for the key "notes".
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Student 0xd36b3e0> valueForUndefinedKey:]: the entity (null) is not key value coding-compliant for the key "notes".'
答案 0 :(得分:1)
在R&amp; D之后,花了很多时间从这里得到了线索 The entity (null) is not key value coding-compliant for the key "title"
只需将路径参数从path = https://xyz.com/api/getStudentHistory替换为path = / api / getStudentHistory 在方法
[[RKObjectManager sharedManager] getObjectsAtPath:path parameters:param success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult)
现在我的问题解决了...... :)