2014-04-05 98 views
1

我正在使用RestKit-0.20.3並遇到問題 我在數據庫中有一個Student表。爲了獲得學生的歷史記錄,執行get api調用,像這樣的https://xyz.com/api/getStudentHistory?x=a&y=b&z=c這樣的url帶有一些參數。 使用這種方法無法使用RestKit-0.20.3調用NSManagedObject類「XYX」上的指定初始值設定項。

[[RKObjectManager sharedManager] getObjectsAtPath:path parameters:param success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) 

在 '路徑'參數passing-路徑= 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

可能重複[The實體(空)不是關鍵字「標題」的編碼兼容鍵值](http://stackoverflow.com/questions/14268580/the-entity-null-is-not-key-value-coding-compliant-for -key-title) – Wain

+0

基本URL和路徑模式的組合需要在所有情況下創建有效的URL,而路徑模式本身僅用於匹配描述符。 – Wain

+0

是@你說得對,我從那裏得到線索我提到它。 – Deepak

回答

1

[R & d和花費大量的時間後得到一個線索從這裏 The entity (null) is not key value coding-compliant for the key "title"

只需更換的路徑我的路徑參數=​​到PATH =/API中的方法/ getStudentHistory

[[RKObjectManager sharedManager] getObjectsAtPath:path parameters:param success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) 

現在我的問題解決了...... :)

相關問題