LKS_Helper.m 873 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // LKS_Helper.m
  3. // LookinServer
  4. //
  5. // Created by Li Kai on 2019/7/20.
  6. // https://lookin.work
  7. //
  8. #import "LKS_Helper.h"
  9. #import "NSObject+LookinServer.h"
  10. @implementation LKS_Helper
  11. + (NSString *)descriptionOfObject:(id)object {
  12. if (!object) {
  13. return @"nil";
  14. }
  15. NSString *className;
  16. if ([object respondsToSelector:@selector(lks_shortClassName)]) {
  17. className = [object lks_shortClassName];
  18. } else {
  19. className = NSStringFromClass([object class]);
  20. }
  21. return [NSString stringWithFormat:@"(%@ *)", className];
  22. }
  23. + (NSBundle *)bundle {
  24. static id bundle = nil;
  25. if (bundle != nil) {
  26. #ifdef SPM_RESOURCE_BUNDLE_IDENTIFITER
  27. bundle = [NSBundle bundleWithIdentifier:SPM_RESOURCE_BUNDLE_IDENTIFITER];
  28. #else
  29. bundle = [NSBundle bundleForClass:self.class];
  30. #endif
  31. }
  32. return bundle;
  33. }
  34. @end