2014-10-19 wcdj
摘要:本文介绍关于Objective-C的一些基础知识,使用的环境是OS X 10.9.5,Xcode 5.1.1版本。
0 创建Hello Objective-C程序
(1) 打开Xcode,选择Create a new Xcode project -> Application -> Command Line Tool,在Type选择Foundation,然后完成。
(2) 修改样本代码。
//
// main.m
// Hello Objective-C
//
// Created by gerryyang on 14-10-19.
// Copyright (c) 2014年 gerryyang. All rights reserved.
//
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
NSLog(@"Hello Objective-C, wcdj!");
return 0;
}
(3) 编译运行代码。
可以使用快捷键Command + R,效果如下: