Xcode 4.2新建工程模板详解

移动开发 iOS
Xcode是进行iOS开发的必备工具,但是用它来进行开发还有一些让人迷惑的地方,让我们来看看Xcode 4.2新建工程中的模板到底有哪些,都能干些甚么。

在Xcode4.2中新建一个工程,有三个大类可选:

Application

 在这个类别下面,你可以看到下面8种可选类型

下面对这些工程一一说明:

1.Document-Based Application

工程缺省说明如下:

This template provides a starting point for a document-based application. It provides an interface to store documents locally or in iCloud.

这个就是iOS新增的一个重要功能--云计算的一个体现,你可以创建一个基于Master-Detail Application类型的工程,不过加入了一个文档的概念,而且这些文档可以无缝保存到云端。

我的试验的结果是在当前情况下,在虚拟机上运行程序还不能保存到云端。

2.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(分割模式)

3.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编程实现其中的功能。

4.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实现的。

5.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.

这个就是大家很熟悉的View-Based Application,没啥好说的。

6.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编辑了。

7.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了,而且很少用到这个模板。

8.Empty Application

工程缺省说明如下:

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

这个就是原来的Window-Based Application.

在另外两个里面,一个是建一个静态类库的工程,一个创建一个完全空的工程。因此在此不再描述。

责任编辑:徐川 来源: OSChina
相关推荐

2011-07-28 14:55:21

Xcode 模板

2011-07-20 10:59:46

2011-07-20 13:50:03

XCode 模板

2011-08-09 15:33:22

Xcode 4.2ARC

2015-08-21 09:43:15

xcode修改注释模板

2011-07-07 09:20:30

Xcode

2023-02-08 18:08:16

2011-07-28 14:31:55

Xcode 调试 异常

2011-07-19 15:44:18

Xcode 卸载

2011-07-20 16:59:07

2011-08-08 17:31:30

Xcode 工程

2011-07-26 14:44:53

调试 Xcode

2011-10-31 14:44:49

2011-07-29 13:40:00

Xcode iOS 4.2 iPhone

2011-03-18 08:39:28

iOS 4.2 SDKiOS SDK

2011-08-04 18:09:32

Xcode 技巧 文档

2011-07-22 18:41:11

Xcode 文档 脚本

2011-08-11 13:10:34

XcodeSVN

2013-04-15 10:48:16

Xcode ARC详解iOS ARC使用

2011-08-01 16:24:04

XCode CodeTimer 测试
点赞
收藏

51CTO技术栈公众号