XCode Interface Builder iPad/iPhone - iphone

Just a silly question that just cant figure out. Ive been working on iPad apps for a while but now Im back on an iphone project.
I created an iphone 4.0 sdk based project but when i double tap on a xib file, IB comes with iPad layout and i cant figure out how to switch it back to iphone layout.
Anyone?

When you create the project, be sure to select Product = iPhone in the "New Project" window.
Also, if you already have the iPad views, you can transform them to iPod/iPhone views through File->Create iPod/iPhone Version using autosizing masks

Partially solved,solution sucks. i created a view based project and there IB shows xib with iphone layout. Couldnt find a solution yet when creating a window based project.

Related

Adding an ipad view after creating an iphone controller

I know Xamarin supports universal iPhone/iPad views; however, after building some iPhone specific screens, it was mentioned about iPad support. In Xamarin Studio, is it easy to add an iPad view attached to the same controller after the fact? I know it uses an idiom to do the switch, as shown below (taken from here):
public Hello_UniversalViewController ()
: base (UserInterfaceIdiomIsPhone ? "Hello_UniversalViewController_iPhone" : "Hello_UniversalViewController_iPad", null)
{
}
Within XCode, how can I then link all the same outlets and actions easily? It seems possible, but looking for any guidance. Or should I just delete them, then re-add them with the universal view?
Thanks for any help...
No you should not delete your iPhone storyboard file instead you make one from file->Storyboard file and select for iPad. You can copy paste controllers from iPhone storyboard but then you have to set the dimensions and other relevant info specific for iPad.
hope this helps :)

Making two storyboards for iOS (iPhone and iPad)

Is it possible to make only one application and inside of it make two storyboards, one for iPhone and one for iPad? I don't like the idea of running the app on iPad and clicking the 2x button.
My idea was to create two storyboards and have a beginning class that would check if the device you are using is an iPhone or an iPad and then redirect to the according storyboard after. I think it is a good idea cause the code is the same.
create two different storyboards and name them so they are easily specified which is which. Then click on the file that allows you to change settings for your actual app. and change the build to universal, then specify which storyboard you want to use!
there is a storyboard setting for iphone and ipad
iPhone
iPad
Make sure the names of the storyboards are correctly set though
Even if you already made an app non universal, just change it to universal (target-->summary), then create a new ipad story board and make sure under target-->summary that the main iphone storyboard and main ipad storyboard are set to the right storyboards.
Did you try creating new Universarl XCode project? If you create Universal project, there will be two Storyboards(One for iPhone and another one for iPad) created by default. i think.
I had to do this in a project recently... so first you should navigate to your projects target then click the summary button in the top bar you will then see a bar that says "iOS Application Target" in there you will see a drop down menu with a title that says Devices select the universal option. Now add a storyboard for the iPad. Now go back to the projects target and scroll down to the "iPad Deployment Info" section and set your new storyboard as the main storyboard in the text field here you can also add the iPad icon and launch images. Now you are set up for creating a universal app!
its very simple, just do the app in universal and then go to the target and then info and then add the main storyborad file base name (iPad) then build and run when iPhone is run to its show iPhone and when iPad run so show as iPad.

Convert iPad app using Storyboard into iPhone app

I have one view which was created for iPad, using a Storyboard.
Now, I want to convert it to an iPhone app.
I am very new to Storyboards. Until now, I have been using separate XIB files.
Can you please explain to me the steps for doing this?
What you want to do is important, if you want your app to just run on both iphone and ipad, you can go to project Summary and then in devices select "Universal" option. This will just run your app in both iphone and ipad(full screen and not 2x). But if you want to look it better then you have to manage your UI assets accordingly.

How to convert xcode 4.1 iPhone app in to Universal app

I recently developed an Application on iPhone in Xcode version 4.1.
Now I need to convert this app for iPad also.
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
Okay, first open your project and click on the project icon, then select the icon below Targets. Select Summary from the right hand side, and change the Devices from iPhone to Universal (under the iOS Application Target). Now your app is ready for iPad. Now to modify the views, if you are not using XIB files, go to your view controllers viewDidLoad / loadView method and write the following code:
if(UI_USER_INTERFACE_IDIOM())
{
// re-size your views here
}
And if you are using XIB files, go to your viewcontrollers XIB file, select the view(i.e view window, label, buttons etc.) and select Show Size Inspector from Utilities.
Now you can see Autosizing panel just under the origins and height-width menu. Select the arrows inside box to set autoResizeMask to get the desired size in iPad and then select the arrows outside the box to set the position in iPad.
And that's it, hope this helps you :) Cheers!
Thanks everyone for helping me out. It turns out that this tutorial explained what I needed.
http://www.youtube.com/watch?v=RY-btZ-KjX0
It might be helpful for others.

iPad Custom Table Cells with plists

I've been following an excellent guide on how to create basic custom table cells and populate them via a plist. The problem i've run into is the guide is written for iPhone, and i'm developing an app on iPad, one of the key issues is when creating the project, the guide uses a Navigation based template for iPhone, where iPad isn't selectable. Later on the guide it says to add outputs to this controller.
I tried following the guide using a Window based template for iPad, but have run into some problems when connecting the output. In particular where I add my 'customTableViewCell' outlet to the 'RootViewController' (which is a UITableController) - in my iPad project, it's just a 'UIViewController'
Is there an easy was to solve this? or is developing it on iPad a totally different tutorial?
thanks.
On the iPad, the Split-View format is really for navigation. It has a root view controller that is a tableview. You might have good luck starting with that template.
In the Interface Builder, you can add UITableView by dragging it onto the view.