0

My root controller for iPhone app is built in code, I im now making app universal and want to link an iPad Xib . Problem is The iPhone screen still loads instead of the ipad xib

My home controller is named IChomeContoller.h and m

So far:

  1. Added iPad xibIChomeContoller~ipad.xib

  2. Set it to my class IChomeContoller in IB

  3. Connected new referencing outlet to the files owner in IB

I also tried it in code in the appdeleage form this example but still not happening

All my other screens are built with xibs and find the ipad xib no problem

Community
  • 1
  • 1
JSA986
  • 5,870
  • 9
  • 45
  • 91
  • Look at my answer in this post, i think its the same cause: http://stackoverflow.com/questions/11384968/info-plist-seems-outdated-and-cannot-validate-app-with-app-store/11385246#11385246 – xapslock Oct 02 '12 at 11:29

3 Answers3

1

Click on your project in Xcode the select your target (should be the bottom one). In there, if it's a universal app, you should see a drop down box for the main screen Xib for both iPhone and iPad. Select a different one for iPad, that should do the trick.

EDIT

Alright, try this out:

In your main view controller, the one that gets initialized by your appdelegate, in the init method:

- (id)init {

    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
        self = [super initWithNibName:@"<Your iPad xib file here>" bundle:nil];
    }
    else {
        self = [super initWithNibName:@"<Your iPhone xib file here>" bundle:nil];
    }

    if (self) {

        // Everything else you got in your init function
    }

    return self;
}
Simon Germain
  • 6,834
  • 1
  • 27
  • 42
1

Sorted

 - (id)init
{

[[NSBundle mainBundle] loadNibNamed:@"ICHomeController" owner:self options:nil];

Added in root view controller

JSA986
  • 5,870
  • 9
  • 45
  • 91
0

Are you sure IChomeContoller~ipad.xib was added to your target? In Xcode, select the file in the Project Navigator (on the left), confirm it's checked in the Target Membership section of the File Inspector (on the right).

mrwalker
  • 1,883
  • 21
  • 23