`
nswish
  • 浏览: 104667 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

在Mac OS X下使用命令行编译Objective-C程序

阅读更多

命令:clang -fobjc-arc -framework Foundation <prog file> -o <exe file> 

样例:

hello.h
——————
#import <Foundation/Foundation.h>

hello.m
——————
#import “hello.h”

int main()
{
     NSLog(@“hello");
     return 0;
}

$ clang -fobjc-arc -framework Foundation hello.m -o hello
$ ./hello   #执行

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics