#import "CoachInfo.h" @implementation CoachInfo +(id)coachInfoWithDict:(NSDictionary*)dict{ CoachInfo* coach = [[CoachInfo alloc] init]; coach.ciName = dict[@"NAME"]; coach.ciSex = dict[@"SEX"]; coach.ciTeachCarType = dict[@"teachCarType"];//@lee-mark CARTYPE coach.ciAddress = dict[@"ADDRESS"]; coach.count = dict[@"COUNT"]; coach.ciMobile = dict[@"mobile"];//@lee-mark TELPHONE 下面也是mobile(都保留吧 先) coach.tel = dict[@"MOBILE"]; coach.star = dict[@"STAR"]; coach.schoolName = dict[@"SCHOOLNAME"]; coach.headImage = dict[@"photo"];//@lee-mark HEADIMG ps:(教练排行榜进入)返回的都是小写 这里。。。 coach.coachSFZHM = dict[@"SFZHM"];//@lee-mark 这个参数没有(教练排行榜进入) coach.score = dict[@"SCORE"];//@lee-mark 这个参数没有(教练排行榜进入) coach.price = dict[@"price"]; coach.desc = dict[@"desc"];//@lee-mark 这个参数没有(教练排行榜进入) coach.watch = dict[@"watch"]; if ([coach.desc isEqualToString:@""]) { coach.desc = @"暂无相关描述"; } if ([coach.price isEqualToString:@""]) { coach.price = @"0"; } return coach; } @end