Ref:http://www.informit.com/articles/article.aspx?p=1819492
Macbook pro (OS X EI Captian 10.11.5)
Xcode 7.3.1
1. Prepare code (main.m)
//
// main.m
// prog1
//
// Created by Steve Kochan on 7/7/11.
// Copyright 2011 ClassroomM, Inc.. All rights reserved.
//
// clang -fobjc-arc -framework Foundation main.m -o prog1
// ,/prog1
//
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
@autoreleasepool {
// insert code here...
NSLog (@"Hello World!");
}
return 0;
}
2. Compile
clang -fobjc-arc -framework Foundation main.m ecute-o prog1
3. Execute
./prog1
4. Result
沒有留言:
張貼留言