在 XCode 上找不到基于窗口的应用程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8005546/
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 22:19:44  来源:igfitidea点击:

Cannot find window-based application on XCode

iphoneiosxcodexcode4

提问by denniss

I am using XCode 4.2 and for some reason I cannot find the template for window-based application. Is there an extra step that I need to take here?

我正在使用 XCode 4.2,但由于某种原因我找不到基于窗口的应用程序的模板。我需要在这里采取额外的步骤吗?

回答by BoltClock

There is no longer a Window-based Application template starting from Xcode 4.2.

从 Xcode 4.2 开始不再有基于 Window 的应用程序模板。

You have two other choices of "bare-bones" templates:

您还有两种“基本”模板可供选择:

  • View-based Application template, which gives you a view on a storyboard to start with. It is similar to the one found in previous versions, except the view now resides on a storyboard which Xcode 4.2 makes use of.

  • Empty Application template, but you'll have to manually create and wire up a window nib file if you want to design your application in Interface Builder. It's nothing more than a trivial extra step, though.

  • 基于视图的应用程序模板,它为您提供故事板上的视图以开始。它类似于在以前的版本中找到的视图,除了视图现在驻留在 Xcode 4.2 使用的情节提要上。

  • 空的应用程序模板,但如果您想在 Interface Builder 中设计您的应用程序,您必须手动创建并连接一个窗口 nib 文件。不过,这只不过是一个微不足道的额外步骤。

If you can't make use of storyboards (e.g. to deploy to iOS 4 and earlier), you most likely need to go with the empty template. For the main window, just make a new Interface Builder file and assign it as your project target's Main Window.

如果您不能使用故事板(例如部署到 iOS 4 及更早版本),您很可能需要使用空模板。对于主窗口,只需创建一个新的 Interface Builder 文件并将其指定为项目目标的主窗口。

回答by Ashu Joshi

Here are two very useful links:

这里有两个非常有用的链接:

  1. The first one is a discussion on the Big Nerd Ranch forum where they discuss this issue - that the XCode 4.2 has done away with the Windows-template. They have a Template that you can use to add the "Windows-template" to your XCode installation. I have NOT tried this approach but you can try.

    http://forums.bignerdranch.com/viewtopic.php?f=73&t=3336

  2. As you dig through this thread - you will come on another site. This a blog post by Jeroen Trappers - on how to "manually" add the missing elements to an "Empty-application" template to make it "Window-template". I have followed these steps and they worked very well for me. In the process of going through these steps it does help you understand what is going on behind the scenes.Here is the URL to the post:

    http://www.trappers.tk/site/2011/06/16/mainwindow-xib/

  1. 第一个是在 Big Nerd Ranch 论坛上的讨论,他们在那里讨论了这个问题 - XCode 4.2 已经取消了 Windows 模板。他们有一个模板,您可以使用它来将“Windows 模板”添加到您的 XCode 安装中。我还没有尝试过这种方法,但你可以试试。

    http://forums.bignerdranch.com/viewtopic.php?f=73&t=3336

  2. 当您深入研究此线程时 - 您将进入另一个站点。这是 Jeroen Trappers 的一篇博客文章 - 关于如何“手动”将缺少的元素添加到“空应用程序”模板以使其成为“窗口模板”。我遵循了这些步骤,它们对我来说非常有效。在执行这些步骤的过程中,它确实可以帮助您了解幕后发生的事情。这是帖子的 URL:

    http://www.trappers.tk/site/2011/06/16/mainwindow-xib/

回答by Chandu

Window-based Application is now Empty Application. Just gives you an app delegate and a window. You build the rest.

基于窗口的应用程序现在是空应用程序。只是给你一个应用程序委托和一个窗口。你建造剩下的。