• Source
    1. #import <objc/objc.h>
    2. #import <objc/Object.h>
    3. #import <Foundation/Foundation.h>
    4.  
    5. @interface TestObj : Object
    6. {
    7. //none
    8. }
    9. - (void)testMethod;
    10. @end
    11.  
    12. @implementation TestObj
    13. - (void)testMethod {
    14. //printing a formatted output of the result of adding integer values.
    15. printf("%d", (1 + 2));
    16. }
    17.  
    18. int main()
    19. {
    20. id obj = [[TestObj alloc] init];
    21. [obj testMethod];
    22. return 0;
    23. }
    24. @end