简体   繁体   English

如何在XCode 5中使用XIB创建iOS项目

[英]How to create an iOS project with a XIB in XCode 5

I'm running xcode 5.0.1. 我正在运行xcode 5.0.1。 In previous version Xcode, there was to be a checkbox for not using storyboard when creating a ios project. 在早期版本的Xcode中,存在一个复选框,用于在创建ios项目时不使用情节提要。 How do I turn off storyboards and just use xib files in xcode 5.0.1? 如何关闭情节提要板,而仅在xcode 5.0.1中使用xib文件?

Unfortunately, the built-in project templates in Xcode 5 mandate storyboards, unless you pick the Empty Application template. 不幸的是,除非您选择Empty Application模板,否则Xcode 5强制情节提要板中的内置项目模板。 Your choices therefore boil down to: 因此,您的选择归结为:

  • Start every project as an Empty Application and add your view controllers from the ground up 作为一个空的应用程序启动每个项目,并从头开始添加视图控制器
  • Start using one of the storyboard-based templates, then: 开始使用基于情节提要的模板之一,然后:
    • Delete the storyboard file 删除情节提要文件
    • Change the main storyboard setting in your project to be empty 将项目中的主要故事板设置更改为空
    • Add .xibs to the existing view controllers as needed 根据需要将.xibs添加到现有视图控制器
    • Implement your app delegate methods as needed to set up a view controller hierarchy 根据需要实现您的应用程序委托方法,以建立视图控制器层次结构

Open a new project as an empty project. 打开一个新项目作为一个空项目。 The selection is in the bottom row, second from the right. 选择内容位于右下角的第二行中。 Then you can add your view controllers in your app delegate. 然后,您可以在应用程序委托中添加视图控制器。 Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM