在具有.xib文件的项目中使用故事板 - iPhone [英] Use storyboards in a project which has .xib files- iPhone

查看:128
本文介绍了在具有.xib文件的项目中使用故事板 - iPhone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的iPhone应用程序中一般使用旧的.xib文件。但是当涉及到tableViewController storyboard是一个很多更方便为了使自定义单元格等。是否可以做一个基于.xib的应用程序,在它的中间,使用一个故事板的UITableViewController和它的DetailedViewController只?

I want to use generally the old .xib files in my iPhone application. But when it comes to tableViewController storyboard is a lot more convenient in order to make custom cells etc. Is it possible to make a .xib based application and in the middle of it, to use a storyboard for a UITableViewController and its DetailedViewController only?

推荐答案

您可以为程序的任何部分使用故事板。故事板不是一个全或无的概念。

You can use a storyboard for any part of a program. Storyboards are not an all or nothing concept. You can have just one view controller in a storyboard, or a small network that just represents a subsection of your app.

从故事板中只使用一个视图控制器:

To use just one view controller from a storyboard:


  1. 向现有项目添加新的故事板。

  2. 将一个视图控制器添加到故事板。

  3. 在检查器中为视图控制器分配标识符。

  4. 使用UIStoryboard类加载故事板资源

  5. 使用 - [UIStoryboard instantiateViewControllerWithIdentifier:]来创建该视图控制器的新实例。

  6. 通过执行某些操作将视图控制器安装到某个地方控制器,或以模态方式运行。

  1. Add a new storyboard to your existing project.
  2. Add a single view controller to the storyboard.
  3. Assign an identifier to the view controller in the inspector.
  4. Use the UIStoryboard class to load the storyboard resource
  5. Use -[UIStoryboard instantiateViewControllerWithIdentifier:] to create a new instance of that view controller.
  6. Install the view controller some place in your app by doing something like pushing it on to a navigation controller, or run it modally.

这篇关于在具有.xib文件的项目中使用故事板 - iPhone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆