如果JSON看起来像这样:
{ "articles": [
{ "title": "This is a example",
"@body": "Some text for the body"
}]
}
你的objective-c课程看起来像这样:
@interface Article : NSObject
@property (nonatomic, copy) NSString* title;
@property (nonatomic, copy) NSString* body;
@end
此代码不起作用:
RKObjectMapping* articleMapping = [RKObjectMapping mappingForClass:[Article class]];
[articleMapping addAttributeMappingsFromDictionary:@{
@"title": @"title",
@"@body": @"body"
}];
如何在JSON中为@body名称指定“@”字符?