これは私の応答本文です:
{
"bsqn": 5,
"results": [
{
"sqn": 1,
"res": "oldu!"
}
]
}
この keyPath:"bsqn.res" を使用して、本当に必要な "res" プロパティを取得したい
//TestResponse.h
@interface TestResponse : NSObject
@property (nonatomic, copy) NSString *res;
+ (RKObjectMapping *)objectMapping;
@end
// TestResponse.m
@implementation TestResponse
+ (RKObjectMapping *)objectMapping
{
RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[self class]];
[mapping addAttributeMappingsFromDictionary:@{@"res": @"res"}];
return mapping;
}
@end
RKResponseDescriptor *newDesc = [RKResponseDescriptor responseDescriptorWithMapping:
[TestResponse objectMapping] method:RKRequestMethodPOST pathPattern:nil keyPath:@"bsqn.res"
statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];
しかし、次のエラーが発生します。
this class is not key value coding-compliant for the key hashcode
私がやりたいことをする方法はありますか?ありがとう..