Created
October 23, 2009 05:40
-
-
Save tedheich/216682 to your computer and use it in GitHub Desktop.
Hello World in Objective C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hello.h | |
#import <Foundation/Foundation.h> | |
@interface Hello: NSObject { | |
} | |
- (void) sayhello ; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hello.m | |
#import "Hello.h" | |
#import <Foundation/Foundation.h> | |
@implementation Hello | |
- (void) sayhello { | |
printf("Hello World\n"); | |
} | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HelloMain.m | |
#import <Foundation/Foundation.h> | |
#import "Hello.h" | |
int main(void){ | |
Hello *helloobj = [[Hello alloc] init]; | |
[helloobj sayhello]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment