#import "Comment.h" #ifndef kSize #define kSize [[UIScreen mainScreen]bounds].size #endif @implementation Comment +(id)commentWithDict:(NSDictionary*)dict { Comment* com = [[Comment alloc] init]; if (com) { /*题目分析 剩下两个找不到(你晚上看看) PHOTO = ""; "QC_CRDATE" = "2017-01-23 16:08:44"; "QC_DESC" = gdfgfd; "QC_DOWN_NUM" = 0; "QC_ID" = 61; "QC_QID" = 1; "QC_TYPE" = 1; "QC_UP_NUM" = 0; "QC_USER_ID" = 1; */ [com setComName:dict[@"QC_NAME"]]; [com setComDesc:dict[@"desc"]]; [com setComDate:[dict[@"date"] substringToIndex:10]]; [com setComUpNum:dict[@"upNum"]]; [com setComId:dict[@"id"]]; com.cellHeight = 105 + [com.comDesc heightForWid:(kSize.width - 80) Font:15]; } return com; } @end