LookinAttribute.m 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifdef SHOULD_COMPILE_LOOKIN_SERVER
  2. //
  3. // LookinAttribute.m
  4. // qmuidemo
  5. //
  6. // Created by Li Kai on 2018/11/17.
  7. // Copyright © 2018 QMUI Team. All rights reserved.
  8. //
  9. #import "LookinAttribute.h"
  10. #import "LookinDisplayItem.h"
  11. @implementation LookinAttribute
  12. #pragma mark - <NSCopying>
  13. - (id)copyWithZone:(NSZone *)zone {
  14. LookinAttribute *newAttr = [[LookinAttribute allocWithZone:zone] init];
  15. newAttr.identifier = self.identifier;
  16. newAttr.value = self.value;
  17. newAttr.attrType = self.attrType;
  18. return newAttr;
  19. }
  20. #pragma mark - <NSCoding>
  21. - (void)encodeWithCoder:(NSCoder *)aCoder {
  22. [aCoder encodeObject:self.identifier forKey:@"identifier"];
  23. [aCoder encodeInteger:self.attrType forKey:@"attrType"];
  24. [aCoder encodeObject:self.value forKey:@"value"];
  25. }
  26. - (instancetype)initWithCoder:(NSCoder *)aDecoder {
  27. if (self = [super init]) {
  28. self.identifier = [aDecoder decodeObjectForKey:@"identifier"];
  29. self.attrType = [aDecoder decodeIntegerForKey:@"attrType"];
  30. self.value = [aDecoder decodeObjectForKey:@"value"];
  31. }
  32. return self;
  33. }
  34. + (BOOL)supportsSecureCoding {
  35. return YES;
  36. }
  37. @end
  38. #endif /* SHOULD_COMPILE_LOOKIN_SERVER */