fork download
  1. #import <objc/objc.h>
  2. #import <Foundation/NSObject.h>
  3.  
  4. @interface TestObj : NSObject
  5. - (void)foo;
  6. @end
  7.  
  8. @implementation TestObj
  9.  
  10. - (void)foo {
  11. [self performSelector:@selector(bar)];
  12. printf("foo\n");
  13. }
  14.  
  15. - (void)bar
  16. {
  17. printf("bar\n");
  18. }
  19.  
  20. int main()
  21. {
  22. id obj = [[TestObj alloc] init];
  23. [obj foo];
  24. return 0;
  25. }
  26. @end
  27.  
Success #stdin #stdout 0.02s 10336KB
stdin
Standard input is empty
stdout
bar
foo