Comment.m 933 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #import "Comment.h"
  2. #ifndef kSize
  3. #define kSize [[UIScreen mainScreen]bounds].size
  4. #endif
  5. @implementation Comment
  6. +(id)commentWithDict:(NSDictionary*)dict
  7. {
  8. Comment* com = [[Comment alloc] init];
  9. if (com) {
  10. /*题目分析 剩下两个找不到(你晚上看看)
  11. PHOTO = "";
  12. "QC_CRDATE" = "2017-01-23 16:08:44";
  13. "QC_DESC" = gdfgfd;
  14. "QC_DOWN_NUM" = 0;
  15. "QC_ID" = 61;
  16. "QC_QID" = 1;
  17. "QC_TYPE" = 1;
  18. "QC_UP_NUM" = 0;
  19. "QC_USER_ID" = 1;
  20. */
  21. [com setComName:dict[@"QC_NAME"]];
  22. [com setComDesc:dict[@"desc"]];
  23. [com setComDate:[dict[@"date"] substringToIndex:10]];
  24. [com setComUpNum:dict[@"upNum"]];
  25. [com setComId:dict[@"id"]];
  26. com.cellHeight = 105 + [com.comDesc heightForWid:(kSize.width - 80) Font:15];
  27. }
  28. return com;
  29. }
  30. @end