https://github.com/nicklockwood/BaseModel

字典封装成model 自动封装

要求属性的名字与字典一样

不能有对象

如果其中有需要自己封装的对象属性

重写setWithDictionary

-(void)setWithDictionary:(NSDictionary *)dict{

[super setWithDictionary:dict];

//user

self.WBuser = [WeiboUser userWithDictionary:[dict objectForKey:@"user"]];

//retweetWeibo

if ([dict objectForKey:@"retweeted_status"] != nil) {

WeiboModel *retModel = [[WeiboModel alloc] init];

[retModel setWithDictionary:[dict objectForKey:@"retweeted_status"]];

self.retweetedWeiboModel = retModel;

}

}

05-11 09:30