歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Objectice-C項目教程:Hello World

Objectice-C項目教程:Hello World

日期:2017/3/1 10:02:58   编辑:Linux編程

跟學習任何語言一樣,Objectice-C的學習同樣以“Hello World”作為開始。

通過這個小工程的創建,大致了解了xcode的基本使用方法,而對於Objectice-C的學習,也總算是邁出了第一步。

下面分步驟來記錄一下這個工程的創建。

1、Xcode啟動完畢後,從File菜單中選擇New Project:

2、進入xcode,新建工程類型如下:

3、在創建工程,保存工程名之後,xcode會顯示主窗口,即項目窗口。

4、在Hello World.m中添加如圖所示代碼:

#import <Foundation/Foundation.h>
int main(int argc, const char *argv[])
{
NSLog(@"Hello Apple!");
return (0);
}

Copyright © Linux教程網 All Rights Reserved