嗨我需要在RKResponseDescriptor中直接设置嵌套的密钥路径,例如" Data.User"但是没有像我的json那样得到Value
{
"Data":{
"User":{
"name": aaa,
"mobile": 123456789
}
"ResultType":1
}
}
我需要直接实体地图给用户没有数据是否可能
编辑:
我的通话代码是
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)
)