我正在将RestKit从0.10更新到0.20,并得到一些我正在尝试解决的错误。
我在Spring.m文件中发现错误
MappingForClass:usingBlock
,没有@接口
mapKeyPathsToAttributes
,并且没有@接口
hasMany:withMapping
.
我自己似乎想不出来。
弹簧.h
@interface Spring : NSObject
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSNumber *id;
@property (nonatomic, strong) NSArray *leafs;
+ (RKObjectMapping *)mapping;
@end
弹簧.m
@implementation Spring
// Creating RestKit object mapping variable, THIS IS WHERE ERRORS OCCUR
+ (RKObjectMapping *)mapping {
RKObjectMapping *objectMapping = [RKObjectMapping mappingForClass:[self class] usingBlock:^(RKObjectMapping *mapping) {
[mapping mapKeyPathsToAttributes:
@"name", @"name",
@"id", @"id",
nil];
[mapping hasMany:@"leafs" withMapping:[Leaf mapping]];
}];
return objectMapping;
}
@end
我正在使用
https://github.com/RestKit/RestKit/wiki/Upgrading-from-v0.10.x-to-v0.20.0
帮我想办法解决这个问题。