Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8405823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:55:54+00:00 2026-06-09T22:55:54+00:00

I have a universal application that works fine on the simulator but when I

  • 0

I have a universal application that works fine on the simulator but when I put it on an actual device (4S and 3rd generation iPad) the View controller interface (“EditNameViewControlleriPhone”, ignore the fact iPhone is part of the name) appears only as the iPhone version even though I also have an iPad xib.

Here is a screen shot of how I named stuff:

enter image description here

A button in my SettingViewController brings up the EditName interface. Here is he code for that:

-(IBAction)editclass{
    EditNameViewControlleriPhone*vc2 = [[EditNameViewControlleriPhone alloc] init];
    vc2.delegate = self;
    [self presentModalViewController:vc2 animated:YES];
}

-(void)dismiss{
    [self dismissModalViewControllerAnimated:YES];
}

Is this code wrong or is there some naming convention that I’m missing or is it something else? Sorry if this is really simple — I’m new to Xcode.
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:55:56+00:00Added an answer on June 9, 2026 at 10:55 pm

    You may manually load the correct interface using the following code:

    -(IBAction)editclass{
        EditNameViewControlleriPhone *vc2;
        if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
            vc2 = [[EditNameViewControlleriPhone alloc] initWithNibName:@"EditNameViewControlleriPhone_iPhone" bundle:nil];
        } else {
            vc2 = [[EditNameViewControlleriPhone alloc] initWithNibName:@"EditNameViewControlleriPhone_iPad" bundle:nil];
        }
        vc2.delegate = self;
        [self presentModalViewController:vc2 animated:YES];
    }
    

    The if-clause checks whether your current device is an iPad or an iPhone. The initialiser within that clause instantiates the viewController using the right xib-file.


    Alternatively, you may leave that up to the system to do by following a simple naming scheme;

    EditNameViewControlleriPhone~iphone.xib for your iPhone Version
    EditNameViewControlleriPhone~ipad.xib for your iPad Version

    That way, your code may remain as is.


    Whenever you find differences in files not being available on device or simulator and vice versa, the usual reason is a problem in capitals. The simulator usually is case-insensitive (depends on your OSX filesystem), the device is case-sensitive (always).


    Last but not least, a build-clean often does wonders when things still keep bugging without plausible explanation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone application that I am currently converting to a universal binary
I have a Core Data app that will end up being an iPhone/iPad universal
I have a Ready for sale application on iTunes connect that is a universal
I have a universal binary application and currently working on the iPad version of
I have an universal application that plays movies from the internet. It has to
I have an iPhone Application that I would like to port to the iPad.
I made a universal application that contains NIB files for both ipad and iphone
I have a Universal (for both iPhone and iPad) application. Are there any advantages
I have a question about using HTTPS in a JBossAS7 web application (a universal
I have a universal data type, which is passed by value, but does not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.