【发布时间】:2014-04-05 03:47:01
【问题描述】:
我正在使用 RestKit-0.20.3 并遇到问题 我在数据库中有一个学生表。要获取学生历史记录,请执行 get api 调用,像这样的 url https://xyz.com/api/getStudentHistory?x=a&y=b&z=c 带有一些参数。 使用这种方法
[[RKObjectManager sharedManager] getObjectsAtPath:path parameters:param success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult)
在'path'参数传递-path = 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".'
【问题讨论】:
-
基本 URL 和路径模式的组合需要在所有情况下创建一个有效的 URL,并且仅使用路径模式来匹配描述符。
-
是的@Wain,你是对的,我从那里得到了线索,我提到了。