Advertisement
elvman

Untitled

Feb 17th, 2015
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.60 KB | None | 0 0
  1. #include <objc/message.h>
  2. #include <stdio.h>
  3.  
  4. #if !defined(OBJC_ROOT_CLASS)
  5. #   if __has_attribute(objc_root_class)
  6. #       define OBJC_ROOT_CLASS __attribute__((objc_root_class))
  7. #   else
  8. #       define OBJC_ROOT_CLASS
  9. #   endif
  10. #endif
  11.  
  12. OBJC_ROOT_CLASS
  13. @interface TestClass
  14.  
  15. +(void) testMethod;
  16.  
  17. @end
  18.  
  19. @implementation TestClass
  20.  
  21. +(void) testMethod
  22. {
  23.     printf("testMethod\n");
  24. }
  25.  
  26. @end
  27.  
  28. int main()
  29. {
  30.     /*Class cls = objc_getClass("TestClass");
  31.     SEL sel = sel_getUid("testMethod");
  32.    
  33.     objc_msgSend(cls, sel);*/
  34.    
  35.     //[TestClass testMethod];
  36.    
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement