iconara
Registered
I want to commit a heresy. I want to create a GUI-less Cocoa application.
I have heard rumors about what one must do to make this work. CocoaDevCentral tells me that I can't really make use of Foundation, but must rely on CoreFoundation, which seems not as sexy. I have however gotten the code below (here written from memory, so it may not be accurate) to compile and run...
Another rumor that I overheard was that one has to make a autorelease pool for autoreleasing to work, I have done this below, and I think it works, but not how or why.
Suggestions anyone? It's cool making commandline apps with OO-methods...
I have heard rumors about what one must do to make this work. CocoaDevCentral tells me that I can't really make use of Foundation, but must rely on CoreFoundation, which seems not as sexy. I have however gotten the code below (here written from memory, so it may not be accurate) to compile and run...
Another rumor that I overheard was that one has to make a autorelease pool for autoreleasing to work, I have done this below, and I think it works, but not how or why.
Suggestions anyone? It's cool making commandline apps with OO-methods...
Code:
int main( ... ) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *msg = [NSString stringWithString:@"running GUI-less"];
printf( [msg cString] );
[pool release];
}