酷店

AlibcReflectionUtil.h 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * AlibcReflectionUtil.h
  3. *
  4. * 阿里百川电商
  5. * 项目名称:阿里巴巴电商 AlibcTradeCommon
  6. * 版本号:3.1.1.93
  7. * 发布时间:2017-03-06
  8. * 开发团队:阿里巴巴百川商业化团队
  9. * 阿里巴巴电商SDK答疑群号:1229144682(阿里旺旺)
  10. * Copyright (c) 2016-2019 阿里巴巴-移动事业群-百川. All rights reserved.
  11. */
  12. #import <Foundation/Foundation.h>
  13. #ifndef AlibcReflectionUtil_h
  14. #define AlibcReflectionUtil_h
  15. @interface AlibcReflectionUtil : NSObject
  16. + (id)getSharedInstance:(NSString *)className;
  17. + (id)getInstance:(NSString *)className instanceMethodName:(NSString *)instanceMethodName;
  18. + (id)executeInstanceMethod:(NSString *)methodName instance:(id)instance params:(NSArray *)params;
  19. + (id)executeClassMethod:(NSString *)methodName clazz:(Class)clazz;
  20. + (id)executeInstanceMethod:(NSString *)methodName instanceAndargs:(id)instance, ...;
  21. @end
  22. #define BC_MAKE_SELECTOR(var_name, sel_name) _Pragma("clang diagnostic push")\
  23. _Pragma("clang diagnostic ignored \"-Wundeclared-selector\"")\
  24. SEL var_name = @selector(sel_name);\
  25. _Pragma("clang diagnostic pop")
  26. #define BC_FETCH_CLASS(className) [NSClassFromString(@#className) class]
  27. #endif