iOS AILinkBleSDK - 蓝牙SDK
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ELEightScaleRecordModel.m 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // ELEightScaleRecordModel.m
  3. // Elink
  4. //
  5. // Created by iot_user on 2020/6/9.
  6. // Copyright © 2020 iot_iMac. All rights reserved.
  7. //
  8. #import "ELEightScaleRecordModel.h"
  9. #import <objc/runtime.h>
  10. @implementation ELEightScaleRecordModel
  11. - (NSString *)description{
  12. NSString * desc = @"\n";
  13. //获取obj的属性数目
  14. unsigned int outCount;
  15. objc_property_t *properties = class_copyPropertyList([self class], &outCount);
  16. for (int i = 0; i < outCount; i ++) {
  17. //获取property的C字符串
  18. objc_property_t property = properties[i];
  19. const char * propName = property_getName(property);
  20. if (propName) {
  21. //获取NSString类型的property名字
  22. NSString *prop = [NSString stringWithCString:propName encoding:NSUTF8StringEncoding];
  23. //获取property对应的值
  24. id obj = [self valueForKey:prop];
  25. //将属性名和属性值拼接起来
  26. desc = [desc stringByAppendingFormat:@"%@ : %@;\n",prop,obj];
  27. }
  28. }
  29. free(properties);
  30. return desc;
  31. }
  32. @end