views:

283

answers:

3

I need to present a modal tab bar controller using interface builder. I'd like to be able to specify and design the tab bar controller in a InfoViewController.xib file, then present it from a variety of locations within the application using something like:

UIViewController *vc = [InfoViewController create];
[self presentModalViewController:vc animated:YES];

I don't know how to setup the interface builder file. I can drag in a tab bar view controller, but it is not displayed when the view controller is presented. How should I link up this tab bar controller with the file owner?

+1  A: 

Interface Builder is for designing your views.

You choose how and when to present them (e.g. modally) inside your code.

Shaggy Frog
Hi. I am trying to setup my views within interface builder. I have setup the presentation call (the snippet above) within a main view controller.
Kevin Sylvestre
+1  A: 

You're over thinking this. Just do exactly what you said you were going to do. Reusability is a good thing.

DysonApps
I am doing exactly what I mentioned and it won't work. I need to link up the tab bar controller so it (and the default view) are presented when the view controller is presented.
Kevin Sylvestre
A: 

I ended up defining the tab bar controller in each XIB it was being presented from (currently only one). Not the ideal situation, but could not figure out how to do it from an external reusable XIB.

Kevin Sylvestre