fork download
  1. #import <objc/objc.h>
  2. #import <objc/Object.h>
  3.  
  4. @interface TestObj : Object
  5. {
  6.  
  7. }
  8. - (void)foo;
  9. @end
  10.  
  11. @implementation TestObj
  12.  
  13. - (void)foo {
  14. printf("foo\n");
  15. }
  16.  
  17. int main()
  18. {
  19. Graphic *graphic = [[Graphic alloc] init];
  20. NSColor *color = [graphic color];
  21. CGFloat xLoc = [graphic xLoc];
  22. BOOL hidden = [graphic hidden];
  23. int textCharacterLength = [[graphic text] length];
  24. if ([graphic isTextHidden] != YES) {
  25. [graphic setText:@"Hello"];
  26. }
  27. @end
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.m: In function 'main':
prog.m:19:5: error: 'Graphic' undeclared (first use in this function)
prog.m:19:5: note: each undeclared identifier is reported only once for each function it appears in
prog.m:19:14: error: 'graphic' undeclared (first use in this function)
prog.m:20:1: error: 'NSColor' undeclared (first use in this function)
prog.m:20:10: error: 'color' undeclared (first use in this function)
prog.m:21:1: error: 'CGFloat' undeclared (first use in this function)
prog.m:21:9: error: expected ';' before 'xLoc'
prog.m:25:1: error: cannot find interface declaration for 'NSConstantString'
prog.m:27:1: error: expected expression before 'end'
prog.m:27:1: error: expected declaration or statement at end of input
prog.m: At top level:
prog.m:27:1: warning: '@end' missing in implementation context
stdout
Standard output is empty