LookinObject.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // LookinObject.h
  3. // Lookin
  4. //
  5. // Created by Li Kai on 2019/4/20.
  6. // https://lookin.work
  7. //
  8. #import <Foundation/Foundation.h>
  9. @class LookinObjectIvar, LookinIvarTrace;
  10. @interface LookinObject : NSObject <NSSecureCoding, NSCopying>
  11. #if TARGET_OS_IPHONE
  12. + (instancetype)instanceWithObject:(NSObject *)object;
  13. #endif
  14. @property(nonatomic, assign) unsigned long oid;
  15. @property(nonatomic, copy) NSString *memoryAddress;
  16. /**
  17. 比如有一个 UILabel 对象,则它的 classChainList 为 @[@"UILabel", @"UIView", @"UIResponder", @"NSObject"],而它的 ivarList 长度为 4,idx 从小到大分别是 UILabel 层级的 ivars, UIView 层级的 ivars.....
  18. */
  19. @property(nonatomic, copy) NSArray<NSString *> *classChainList;
  20. @property(nonatomic, copy) NSString *specialTrace;
  21. @property(nonatomic, copy) NSArray<LookinIvarTrace *> *ivarTraces;
  22. #pragma mark - Non Coding
  23. /// 在 OC 中,completedSelfClassName 和 shortSelfClassName 返回值一样。在 Swift 中,completedSelfClassName 返回的是带命名空间的(比如 LBFM_Swift.LBFMHomeController 或 _TtC 11TestRuntime14ViewController),而 shortSelfClassName 返回的是没有命名空间的(比如 LBFMHomeController)
  24. @property(nonatomic, copy, readonly) NSString *completedSelfClassName;
  25. @property(nonatomic, copy, readonly) NSString *shortSelfClassName;
  26. @end