Reputation: 8131
i have a tabbar controller created by interface builder. It has 5 tab with 5 views.
Now i can porting this project in ipad compatible version.
Using xcode and IB i created the correct views for ipad with "create ipad version using autosizing masks".
I have TestView_iPad.xib
and TestView.xib
Ok!
Now, how can i load at startup in my tabbar controller the iphone or ipad correct nib file??? What is the right way?
I need to do this in my testview controller or in my appdelegate?
I recognize the devices correctly, but i not able to load from different nib file, because it where setted from interface builder (Nib Name = "TestView" from Inspector)!
someone have a trick?
thanks,
A
Upvotes: 1
Views: 524
Reputation: 2937
For my iOS app, I use two different NIBs and yes, they both have UITabBarControllers. The way I do it is by adding a key to my Info.plist: Main nib file base name (iPad)
and copy the iPhone xib and rename it (Example: TabBar_iPad.xib) Then add your new xib's name as the value for Main nib file base name (iPad)
and enter the xib's name destined for the iphone under the key Main nib file base name (iPhone)
It works great!
Upvotes: 1