Skip to content

Instantly share code, notes, and snippets.

@nsdevaraj
Created January 29, 2013 09:19
Show Gist options
  • Save nsdevaraj/4662934 to your computer and use it in GitHub Desktop.
Save nsdevaraj/4662934 to your computer and use it in GitHub Desktop.
Command Line Interface for Cocoa
$cat > main.m
#import <Foundation/Foundation.h>
int main() {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *words = [NSArray arrayWithObjects:@"Hello,", @"world!", @"Check", @"this", @"out!", nil];
NSLog(@"%@", [words componentsJoinedByString:@" "]);
[pool release];
return 0;
}
$cc -framework Foundation -o my-app main.m
$./my-app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment