Ios6 RestKit响应图问题-<;RKMappingResult:,results={";<;null>=
我正在使用RESTKit0.20.0Ios6 RestKit响应图问题-<;RKMappingResult:,results={";<;null>=,ios6,restkit,restkit-0.20,Ios6,Restkit,Restkit 0.20,我正在使用RESTKit0.20.0 { "CreateSession" : yes, "DistributionChannel" : "string1", "Login" : "string2", "Nickname" :"string3", "Password" :"string4", "PhysicalDevice" : { "DeviceId" : "string5", "DeviceTypeCode" : 123, "Phys
{
"CreateSession" : yes,
"DistributionChannel" : "string1",
"Login" : "string2",
"Nickname" :"string3",
"Password" :"string4",
"PhysicalDevice" :
{
"DeviceId" : "string5",
"DeviceTypeCode" : 123,
"PhysicalDeviceTypeCode" : 1233,
}
}
是我干的
NSDictionary * dictionary = @{
@"CreateSession":@"yes",
@"DistributionChannel":@"string1",
@"Login": @"string2",
@"Nickname": @"string3",
@"Password": @"string4",
@"PhysicalDevice": @{ @"DeviceId": @"string5",
@"DeviceTypeCode": @"123",
@"PhysicalDeviceTypeCode": @"1233" }
};
RKObjectMapping *registerDeviceRequestMapping = [RKObjectMapping requestMapping];
[registerDeviceRequestMapping addAttributeMappingsFromDictionary:dictionary];
分别为请求和响应创建描述符。将其添加到RKObjectManager共享对象中,还设置了基本url和标头
我打电话来启动这个请求
RKHTTPRequestOperation *operation = [[RKObjectManager sharedManager] appropriateObjectRequestOperationWithObject:dictionary method:RKRequestMethodPOST path:@"RegisterDevice" parameters:nil];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"response %@",[responseObject description]);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Failed with error: %@", [error localizedDescription]);
}];
[operation start];
我获得了200个状态,但无法从响应映射值。我得到的映射结果为
<RKMappingResult: 0x849bf60, results={
"<null>" = "<Response: 0x849b390>";
注意:请求和响应中的值是伪值,但其结构如下所示
{
"PhysicalDevice": {
"AddDate": "string1",
"AuthenticationKey": "string2",
"DeviceId": "string3",
"DeviceTypeCode": 33,
"DeviceTypeName": "string4",
"Id": 10130,
"ModDate": "2013-09-27T07:21:34.240Z",
"PhysicalDeviceTypeCode": 1233,
"SerialNumber": "string5",
"Status": 1,
"StatusName": "string6"
},
"RemainingDeviceAssociations": 4,
"SessionId": "string7"
}