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 5847851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:46:38+00:00 2026-05-22T12:46:38+00:00

am a noob at universal apps so please help me out and let me

  • 0

am a noob at universal apps so please help me out and let me know if this can be done, I am creating a universal app and for doing this i have written the code and made the settings in each of my view controllers present in the iPhone and iPad group and at runtime i am identifying the device whether its iphone or ipad i am using the below method

 if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    {
        myiPad_View *ipadObj = [[myiPad_View alloc]init];
        [self.window addSubview:ipadObj.view];

    }
    else
    {
        myiPhoneView *obj = [[myiPhoneView alloc]init];
        [self.window addSubview:obj.view];
    }

Now the query is my boss is eating my head for this he is telling me that can we write just one class and at run time when the app will be launched either in iphone or ipad device or simulator the view controller will adjust the frames accordingly i have done this by using the above method but he says if you do like this then the code will increase and you have to suffer a huge headache so actually he is right but haven’t found of any alternate solution to this, so before saying this cant be done i thought of taking some expert advice

  • 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-05-22T12:46:39+00:00Added an answer on May 22, 2026 at 12:46 pm

    Your above method is actually how I determine devices in some of my apps as well.

    I actually recently wrote a little piece on this issue.

    You can also use:

    #define IDIOM    UI_USER_INTERFACE_IDIOM()
    #define IPAD     UIUserInterfaceIdiomPad
    #define IPHONE   UIUserInterfaceIdiomPhone
    
    if ( IDIOM == IPAD ) 
        NSLog(@"Device is iPad.");
    else 
        NSLog(@"Device is iPhone or iPod touch.");
    

    or

    if ( [[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"] ) 
    {
        NSLog(@"Device is an iPod touch");
        /*  same goes for "iPhone", "iPad" etc.  */
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Noob here and I have 2 questions. 1) When creating an array like this
Noob question here. Please see code below. Where can I read more on this?
Noob question here! I have an array with hashes that looks like this: arr
Noob question. I have this: Array ( [0] => address = 123 Something Street
Noob question. I have this situation where I have these objects: class Address {
noob here and need help from the pros... i am doing a voice record
Noob Question I know but can you explain to me how I can install
Noob developing a Magento theme and I can't seem to figure out why Magento
Noob question : I have the following Forms layout (please excuse the JRuby syntax).
Noob here. I have a rails app that has users and postings. I need

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.