Created
September 22, 2014 10:55
-
-
Save ikuwow/04c22f0667eacf8950e1 to your computer and use it in GitHub Desktop.
MacのターミナルでObjective-Cをコンパイルする方法 ref: http://qiita.com/ikuwow/items/5470ffea3bf7403fe0a7
This file contains 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
$ gcc -c main.m |
This file contains 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
$ gcc -c main.m | |
$ gcc -c Song.m | |
$ gcc -c Singer.m | |
$ gcc -o myFirstProgram main.o Song.o Singer.o -framework Foundation |
This file contains 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
#import "Song.h" | |
#import "Singer.h" | |
int main(void) { | |
id song; | |
id singer; | |
song = [[Song alloc] init]; | |
[song setLyrics:@"それが僕達の奇跡"]; | |
singer = [[Singer alloc] init]; | |
[singer setSong:song]; | |
[singer sing]; | |
return 0; | |
} |
This file contains 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
#import <Foundation/NSObject.h> | |
#import <stdio.h> | |
(略) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment