Skip to content

Instantly share code, notes, and snippets.

@tai2
Created August 13, 2013 19:00
Show Gist options
  • Select an option

  • Save tai2/6224498 to your computer and use it in GitHub Desktop.

Select an option

Save tai2/6224498 to your computer and use it in GitHub Desktop.
Hello world for Objective-C
#import <Foundation/Foundation.h>
@interface HelloWorld : NSObject
- (void) hello;
@end
@implementation HelloWorld
- (void) hello {
NSLog(@"hello world!");
}
@end
int main(void) {
HelloWorld *hw = [[HelloWorld alloc] init];
[hw hello];
[hw release];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment