how to set directly nested keypath in Restkit?

烂漫一生 提交于 2020-01-17 05:38:38

问题


hi i need to set directly nested keypath in RKResponseDescriptor like "Data.User" but not getting Value my json like below

{
 "Data":{
       "User":{
            "name": aaa,
            "mobile": 123456789
        }
 "ResultType":1
 }
}

i need directly entity map to User Without data is it possible

EDIT:

my calling code is

 let userMapping = RKEntityMapping(forEntityForName: "User", inManagedObjectStore: rkomUser.managedObjectStore)

userMapping.addAttributeMappingsFromDictionary([
    "Name"                    : "name",
    "Mobile"                  : "mobile"
    ])


let responseDescriptor = RKResponseDescriptor(

    mapping: userMapping,

    method: RKRequestMethod.POST,
    pathPattern: nil,

    keyPath: "Data.User",
    statusCodes: NSIndexSet(index: 201)
)

来源:https://stackoverflow.com/questions/34000051/how-to-set-directly-nested-keypath-in-restkit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!