Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
291 views
in Technique[技术] by (71.8m points)

ios - Use storyboards in a project which has .xib files- iPhone

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...