How to convert xcode 4.1 iPhone app in to ipad app - iphone

I was recently developed a big project on iPhone in Xcode version 4.1.
Now i need to convert this app for iPad.
I have verified so many links but all are regardig Xcode 3 ond it's extensions.
How to upgrade, how to resize the view etc etc
Please help me. Thanks in advance

Your best bet would be to create two new projects, one for iPhone, and the other universal and see what differences are in place there, especially the app delegates.
Quite a lot of the things won't be needed, however the app initialisation need some consideration, and most views tend to happily scale up to ipad resolutions without much or any additional work.
That was how I added iPad support into one of my apps I was writing anyway.

Depends how your app is build. If you are using Builder in XCode you can simply create new xib for each controller/view you have in app and name it with suffix ~ipad.
So if you for example have MyController.xib you will create MyController~ipad.xib and your controller will be loaded from this file automatically when run on iPad.

Changing the project preferences to universal gives you the possibility to specify a second MainWindow.xib in the info.plist file (Main Nib file base name (iPad)) which is the starting point for your iPad Interface. At this point running the app on an iphone would load your original interface and running on an iPad gives you the blank window once you created the corresponding blank MainWindow file.
Edit: You need also a second AppDelegate that holds the reference to your new window.

Related

convert an ipad app to iphone app with custom views

This might be a repeat question.But i have a problem. I have an iPad app functional. The app is built in iOS 6. When i started building it i chose iPad as targeted device NOT universal. Now my client has asked for an iPhone version of it.In my iPad app i keep adding custom views as the client clicks "Add More".I add a custom view which is bunch of textfields, buttons etc.So i copied my iPad app and changed the Targeted device family to iPhone once and also Universal next time and tested it. So when i launch the app in iPhone configuration (keeping the targeted device family as Universal) my view controller stays like that on iPad. I cannot scroll the app also(not up/down..nor sideways). Is this the correct way to convert iPad app to iPhone app . Also everything is still with scale to iPad. Should i start a new project and start everything from scratch.Set the storyboard to fit according to iPhone configuration? In my research people said just change the targeted device family to Universal. But it doesn't work. Please let me know if you need more information. Thanks.
It is possible to convert the current project you have to an app that can be used universally, but it would take more time than simply just creating a new project that allows universal usage, and adding in the files of which you used for your iPad project.
Hint: You can use more than one storyboard when the project was created universally. It will automatically set this up for you.
I would also advise that you separate your files into what works universally, and what is specific for the iPhone or the iPad.
Happy Coding!
After many search i found that it possible to have an application for both Iphone and ipad devices.but in your code you should define unique ui for each device(two xib file).

Develop iPad Version or iPhone Version first?

I have just finished developing an iPhone app and now I wish to make it a Universal App. I'm having issues incorporating a UISplitView into my current code to accommodate multiple detail views. I have looked at Apple's MultipleDetailViews sample code and have tried to insert into my project but it's becoming more of a headache than it should.
I'll copy all the project files from Apple's MultipleDetailViews sample code into my project, adjust my app delegate to check to see if an iPad's running, set the window to add a subView of splitViewController.view, but all I get is blank white screen when I build and run.
So my question is, do I develop the iPad version from a new project and then add my iPhone project files when I'm done?
OR
Do I make a separate iPad app and forget the whole Universal App?
Thoughts and suggestions would be much appreciated.
I would start with a Universal Project and generate content for the iPad, I've found downsampling easier than upscaling :). Try and make everything generic (based off the view height and width). This will make conversion to the iPhone/iPod easier.
I think there is more to creating a Universal build from the outset than just checking for iPad view.
You need to set the project up as a universal build in the build settings. I know default projects that are universal create a group of folders with a main view for iPhone and iPad. You will need to create separate views for iPhone and iPad.
I would create a dummy project that is universal and compare settings and default values. Try adding these to your project and see if you have better results.
But I wouldn't think you should put one before the other. Build the one you think you will have the most success with first, then if you still need it, build out for the other. Good luck.

Convert simple iPhone app to Universal app

I have very simple iPhone app, which uses just UIButtons, UIlabels, UITableView. without any custom controllers and graphics. How can I convert app to universal with that UI?
First update the application target device to Universal.
Update the application target device to Universal.
Check the Info.plist for NSMainNibFile & NSMainNibFile~ipad keys.
For all other views, have two different NIB. For example FirstView.xib & FirstView~ipad.xib. iOS runtime will load the proper view based on the device.
Here is a screenshot of a sample project:
I needed to convert my iPhone App to iPad yesterday and found the easiest way to do it as long as your app is pretty simple. Mine was literally just some tableViews that were set to auto-size. In Targets / Devices just change it from 'iPhone' to 'Universal' and then build your application. This worked very nicely for me. All tableViews were perfectly formatted for the iPad and that is really all I needed.
Note that if you had any other XIB files that were not just tableViews, such as a window with text fields, all you have to do is set them each to resize properly so they stretch and stay at the top and your simple app should be pretty much all set for the iPad.
Obviously you'll need to test it and tweak anything needed but for the most part the above worked magically for me and took literally one second to convert my iPhone app to an iPad app!

Xcode help - Upgrade current target for iPad

I upgraded current target for iPad (to try and make a universal app) without making any changes and it doesn't seem to have worked. The only .xib file that was added to the iPad resources folder was MainWindow-iPad.xib, and no others.
Anyway disregarding that I tried to switch the active executable to ipad simulator. It runs but the layout has gone completely crazy. I can't fix it because there is no .xib in the iPad resources folder. :/
You have to convert your other NIB files manually. Interface Builder has a menu command to get you started. Just open all your NIBs one after the other, convert them to iPad dimensions and save them under a new name. Then, in your code, make sure that you load the correct NIB file depending on the platform your app runs on.

Compiling the same Xcode project for iPhone and iPad with different xib files

I would like to know if it's possible to compile the same Xcode project for both iPhone and iPad, automatically changing the xib file according to the platform. The project will contain both xib files. If this is possible, how can be done?
Thanks
You can create Universal application which contains both kind of application supporting.
Create new Xcode project > Window based application in that select Universal from drop down menu.
it will provide you two different files one for iphone and another for ipad.
and check this link to know every thing about you question.