Convert xcode 4.6 iPhone app in to Universal app - iphone

I am trying to upgrade my existing iPhone app project to an Universal app,
I have implemented following steps,
Step 1: Project Navigator - target - Summary - devices - Universal (From iPhone to Universal)
Step 2: Created TabBar with NavigationBar Flow in Storyboard,
When i run my project in iPhone it works properly but when i run in iPad it shows only TabBar with NavigationBar.
Now my problem is how to create new .xib files for iPad ? Xocde doesn't created automatically when i selected my device from iPhone to Universal.
or
How to map my iPhone .xib files with iPad.
Do i need to create new Outlet and action for all buttons which are there in my iPhone .xib?
Thanks in advance.

Create a new xib for all your view controllers ,name the view controllers with "~ipad " as a suffix(ex. FirstViewController~ipad.xib)
xcode will automatically use the xib when the application run in ipad. Link your newly created xib with appropriate classes through identity inspector in xib.
Note : After creating a new xib, add all the controls as added in existing view controller and link newly added controls with file owner.
add all the controls and link with file owner.

Related

Object library changes using XCode 4 and storyboard

When working in the .h or .m of my iPhone app in XCode, the Object Library contains a lot of nice buttons and stuff, i.e. a checkbox, which I would like to add to the interface. But when I enter the storyboard, it changes to just "Objects" and many of the buttons are replaced with view controllers and other stuff. How can I find the Object Library with all the buttons in my storyboard? I wanna add some checkboxes etc in my app. Thanks.
See when you are working in .h and .m the object library shows all the stuff of iPhone/iPad and Mac.but when you open storyboard for iPhone/iPad all the stuff regarding Mac development is gone ,only the stuff relevant to iPhone/iPad is shown.

Strategy for developing Universal IOS application

I have an iPhone application available in appstore.
Now i would like to develop Universal version of the same app.
The iPad version of the current application will be the same. Just screens will be adapted for iPad size. The behaviour won't be changed due to device type.
My question is below:
In iPhone version, there is a page which displays hotel list.
The controller class is:
HotelListViewController.m
HotelListViewController.h
the xib is: HotelListViewController.xib
Now which is best practice for making same page of iPad:
Option 1:
Just creating HotelListViewControlleriPad.xib
and using same HotelListViewController.m and .h
Option 2:
Creating HotelListViewControlleriPad.xib
creating HotelListViewControlleriPad.m and h
thanks.
You need to go by option 1, as only view differs so you need to have different xib for iPhone and iPad.
If in your controller, there is certain view related stuff then you can handle that stuff conditionally.
You can check this thread also for some interested related discussion - How to develop an universal app for iPhone + iPad without xib files?
Either go for option 1 or use the same xib and view controller class as in iPhone but make the view controller a child view controller of the full screen view controller on iPad (for example using split view controller or a custom container view controller).

Absence of MainWindow.Xib in iOS 5

In iOS 5 sdk with Xcode4.2 i started creating an app with Empty Application Template.But in that template there is no MainWindow.xib.Some posts says to add a MainWindow manually.Is that the right way or proceeed the same without MainWindow.xib for a navigation Based application
The empty application template does not contain any other files - it's an empty template! If you want to create a navigation based application, you can do it in code by creating a navigation controller and setting it as the root view controller of the application window, or you can create your own xib file and set it to the "Main Interface" in your target summary settings.
For information, in XCode4.2/iOS5.0, Apple added the concept of story boards. Now by default, no MainWindow.xib file is created but MainStoryboard.storyboard. You can use it to develop your application. BUT, for backward compatibility, prefer add a nib file that you can name MainWindow.xib. I do not know any other way to use NIB files as it was done before XCode4.2

Load different view for different device on UITabBarController load

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

Adding UISplitviewController to nib file of universal app, object not showing

So I've upgraded my iphone app to a universal app and am trying to add a uisplitviewcontroller. In MainWindow-ipad.xib, when I try to drag an object to the window, uisplitviewcontroller isn't an option. Furthermore, the screen size is the iphone's dimensions, not the ipad's. How do I get this to work with the universal app?
Thanks.
Valid XHTML http://img687.imageshack.us/img687/504/screenshot20100809at436.png
So I found out how to do it. You have to convert it to an iPad nib.