JSON与Objective-C对象映射:BWObjectMapping
BWObjectMapping是一个非常小的Objective-C库,几乎能够自动解析JSON并将其映射到任何对象。支持 NSManagedObject。
My object
@interface User : NSObject @property (nonatomic, strong) NSNumber *userID; @property (nonatomic, strong) NSString *firstName; @property (nonatomic, strong) NSDate *createdAt; @end
My json
{ "id": 14, "first_name": "Wernimont", "created_at": "2013-12-12T14:11:10Z" }
User *user = [[BWObjectMapper shared] objectFromJSON:JSON withObjectClass:[User class]];
本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!