I'm writing some very quick, 1 file command line programs (Xcode and Obj-c of course) and am not sure how to include methods. For instance, this is basically what I want to do:
The above errors out with "fatal error: method definition not in @implementation context".
Thanks for any help.
Ashley
Code:
#import <Foundation/Foundation.h>
-(NSString *) returnHello {
return @"Hello";
}
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog(@"%@", [self returnHello]);
[pool drain];
return 0;
}
The above errors out with "fatal error: method definition not in @implementation context".
Thanks for any help.
Ashley