문제

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?

도움이 되었습니까?

해결책 3

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.

다른 팁

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

Interface Builder is for designing your views.

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top