1 //Source code start
2
3 #import <Foundation/Foundation.h>
4
5 int main (int argc, const char * argv [])
6 {
7 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
8 NSLog (@"Hello World!");
9
10 [pool drain];
11 return 0;
12 }
13
14 //Source code end
編譯的方式為:
gcc -framework Foundation helloworld.m -o helloworld
helloworld.m 為編譯原始碼檔, Objective-C 使用的附檔名為 .m
helloworld 為編譯出來後的可執行檔
沒有留言:
張貼留言