新 iPhone 应用程序 - 如何选择要使用的 Xcode 模板?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/366899/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:26:27  来源:igfitidea点击:

New iPhone App - How to Choose which Xcode Template to Use?

iphonexcodeprojectxcode-template

提问by Greg

In general I'd like to understand which templates to use when, when I'm making new iPhone apps. Could anyone offer some guidelines, tips, rules-of-thumb?

一般而言,我想了解在制作新 iPhone 应用程序时使用哪些模板。谁能提供一些指导方针、技巧、经验法则?

Also, how much should I agonize over this? If I start off with the wrong one, can I add the missing pieces manually, is it hard?

另外,我应该为此苦恼到什么程度?如果我从错误的开始,我可以手动添加缺失的部分,难吗?

For reference here are the choices I'm seeing:

作为参考,这里是我看到的选择:

  • Navigation-Based Application
  • OpenGL ES Application
  • Tab Bar Application
  • Utility Application
  • View-Based Application
  • Window-Based Application
  • 基于导航的应用程序
  • OpenGL ES 应用程序
  • 标签栏应用
  • 实用程序
  • 基于视图的应用程序
  • 基于窗口的应用程序

采纳答案by user20282

Start with your prototype and possibly wireframes and then the correct template should jump out at you.

从您的原型和可能的线框开始,然后正确的模板应该会出现在您身上。

If this does not work for you, then:

如果这对您不起作用,那么:

  1. If your app looks like 'Contacts', use Navigation-Based Application.

  2. If you're writing a game (or something that looks like one), then OpenGL.

  3. If you're writing something like 'Calendar', then use Tab Bar App.

  1. 如果您的应用看起来像“联系人”,请使用基于导航的应用。

  2. 如果您正在编写游戏(或类似的游戏),那么 OpenGL。

  3. 如果您正在编写类似“日历”的内容,请使用 Tab Bar App。

Hope this helps.

希望这可以帮助。

回答by Daniel Silveira

In iPhone Development Quick Start, from Apple, you have a brief description of each:

在Apple 的iPhone 开发快速入门 中,您对每个都有一个简短的描述:

  • Navigation-Based Application.An application that presents data hierarchically, using multiple screens. The Contacts application is an example of a navigation-based application.
  • OpenGL ES Application.An application that uses an OpenGL ES–based view to present images or animation.
  • Tab Bar Application.An application that presents a radio interface that lets the user choose from several screens. The Clock application is an example of a tab bar application.
  • Utility Application.An application that implements a main view and lets the user access a flipside view to perform simple customizations. The Stocks application is an example of a utility application.
  • View-Based Application.An application that uses a single view to implement its user interface.
  • Window-Based Application.This template serves as a starting point for any application, containing an application delegate and a window. Use this template when you want to implement your own view hierarchy.
  • 基于导航的应用程序。使用多个屏幕分层呈现数据的应用程序。联系人应用程序是基于导航的应用程序的一个示例。
  • OpenGL ES 应用程序。使用基于 OpenGL ES 的视图来呈现图像或动画的应用程序。
  • 标签栏应用程序。一个应用程序,它提供一个无线电界面,让用户可以从多个屏幕中进行选择。时钟应用程序是选项卡栏应用程序的一个示例。
  • 实用程序。实现主视图并允许用户访问翻转视图以执行简单自定义的应用程序。Stocks 应用程序是实用程序应用程序的一个示例。
  • 基于视图的应用程序。使用单个视图来实现其用户界面的应用程序。
  • 基于窗口的应用程序。此模板可作为任何应用程序的起点,其中包含一个应用程序委托和一个窗口。当您想要实现自己的视图层次结构时,请使用此模板。

回答by Lily Ballard

If you don't know what template to use, it seems like your idea needs some refining. Usually, the app idea lends itself specifically to one of the templates.

如果您不知道使用什么模板,您的想法似乎需要一些改进。通常,应用程序创意特别适用于其中一个模板。

And no, you shouldn't agonize over this. If you start with the wrong template, you can add the missing pieces without much effort. You can even create a brand new project with the template you want and see how they do it, and just copy that in your program.

不,你不应该为此苦恼。如果您从错误的模板开始,您可以毫不费力地添加缺失的部分。你甚至可以用你想要的模板创建一个全新的项目,看看他们是怎么做的,然后把它复制到你的程序中。

回答by Rhubarb

Also note - there aren't that many templates. Create a new project for each one, Build and Run immediately, and you'll get an idea what you need.

另请注意 - 没有那么多模板。为每个项目创建一个新项目,立即构建并运行,您就会知道自己需要什么。