XCode 4.2.1 項目的幾個模版說明

XCode 4.2.1 項目的模版截圖:

 

Single View Application

 

This template provides a starting point for an application that uses a single view. It provides a view controller to manage the view, and a storyboard or nib file that contains the view.

最常用的應用模版,XCode 之前版本的 View-Based Application 跟這個最像。

剛開始學習HelloWorld 就應該從這個開始。

只有一個頁面

 

Master-Detail Application

This template provides a starting point for a master-detail application. It provides a user interface configured with a navigation controller to display a list of items and also a split view on iPad.

很多有過一些開發經驗的程序員會發現現在爲iPhone的Navigation(導航模式)和爲iPad的Split(分割模式)的工程模板沒有了,其實 這個地方就是這兩種工程的入口,如果你選擇是iPhone版的Master-Detail Application,其實際生成的就是Navigation(導航模式),如果選擇iPad,則爲Split(分割模式)

Master-Detail 模板能夠創建和 Mail 相似的應用。如下,左邊導航是 Master,右邊每封郵件的細節是 Detail。

 

 

ios5之ipad開發之分割試圖與彈出層的使用
http://dabailiang.blog.51cto.com/3498372/829542

 

OpenGL Game

This template provides a starting point for an OpenGL ES-based game. It provides a view into which you render your OpenGL ES scene, and a timer to allow you to animate the view.

這個是生成一個基於OpenGL的工程,值得說明的是,iOS已全面支持OpenGLES 2.0,並且使用shader編程實現其中的功能。

如果你要創建3D遊戲或者圖形,可以使用這個模板。它會創建一個配置好的視圖,專門用來顯示GL場景,並提供了一個例子計時器可以令其演示動畫。

 

Page-Based Application

This template provides a starting point for a page-based application that uses a page view controller. 

這個是iOS5引入的一個新的類,page view controller,其翻頁效果是基於OpenGLES實現的。

選擇“Page-based Application”項目模板就可以利用這個模板創建一種“基於頁”的應用程序,

如下圖,我們可以借用它實現如下的效果:

iOS5 Page-Based Application模板擬真翻頁 pdf和ePub源碼問題探討
http://www.devdiv.com/forum.php?mod=viewthread&tid=107224 

 

Tabbed Application

This template provides a starting point for an application that uses a tab bar. It provides a user interface configured with a tab bar controller, and view controllers for the tab bar items.

這個就是大家熟悉的Tab Bar Application,值得一提的就是,現在控制Tab bar內容及其相關View controller都是使用代碼來實現的。Tab bar從一開始就可以使用代碼控制,不過大部分時候可以通過IB來定義,在XCode4.0之前和4.0中,IB在這個地方的使用方式不同。現在終於要放 棄使用IB編輯了。

Tabbed 模板能夠創建一個和 iTunes 類似的應用

提供了一種特殊的控制器,會沿着屏幕底部顯示一個按鈕欄。這個模板適用於像iPod或者電話這樣的應用程序,它們都會在底部顯示一行標籤,提供一系列的快捷方式。

如何創建一個Tab bar Application (xcode 4.2中或者代碼的方式)
http://blog.csdn.net/nicktang/article/details/6854996

 

 

Utility Application

This template provides a starting point for a utility application that has a main view and an alternate view. For iPhone, it sets up an Info button to flip the main view to the alternate view. For iPad, it sets up an Info bar button that shows the alternate view in a popover.

這個唯一新增的就是支持iPad了,而且很少用到這個模板。

 

Xcode Utility Application 例子 數據傳遞與共享
http://hi.baidu.com/ghina/blog/item/d90bf8b3622d04b8d9335ae7.html

如下圖,第一個頁面右下角點擊 i 按鈕, 出現第二個頁面。

 

Empty Application

This template provides a starting point for any application. It provides just an application delegate and a window.

這個就是原來的Window-Based Application.

如果其他模板都不適合你的需求,就只有用這個非常簡單的模板了。它提供了一個簡單的、帶有一個窗口的應用程序。這是一個應用程序所需的最小框架,你可以用它作爲開始來編寫你自己的程序。

 

 

 

 

XCode 3 跟 XCode 4 項目模版的對應關係可以看下錶:

Navigation-based Application  ——->Master-Detail Application => iphone

Splite View-based Application ——->Master-Detail Application => ipad

OpenGL ES Application —————>OpenGL Game

Tab Bar Application      —————>Tabbed Application

Utility Application         —————>Utility Application

View-based Application —————>Single View Application

Window-based Application————>Empty Application

 

 

在另外兩個裏面,一個是建一個靜態類庫的工程,一個創建一個完全空的工程。因此在此不再描述。

 轉自:http://www.cnblogs.com/ghj1976/archive/2012/04/11/2442569.html

參考資料:

Xcode 4.2 環境下Application8種可選類型分析
http://hi.baidu.com/lee_shine/blog/item/8e2015346fa30594a61e12fc.html

正式投入學習 > 你的第一個 iOS 應用 – 2.開始上手
http://www.guomiicom/posts/20868

新老版 Xcode 的區別
http://waibo.net/2012/03/08/1181.html

Xcode 應用程序常用模板
http://www.cnblogs.com/zjz008/archive/2011/03/23/1992589.html


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章