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. I have a rails app that has users and postings. I need
Noob Question I know but can you explain to me how I can install
Noob ADO.NET question: Can I do the following? Retrieve a DataTable somehow. Dispose it.
Noob here. I have a super column family sorted by timeuuidtype which has a
Noob Question here. I have created and successfully added an additional Page Layout to
Noob question. I have been programming at basic level for quite a while but
XNA noob here, learning every day. I just worked out how to composite multiple
Noob question, using Win7 64-bit, Clojure 1.2.0, Java 1.6.0_22 When I start clojure from
Noob in mod_rewrite here...I'm developing a new site and using mod_rewrite. The problem is,
Noob here... :) I'm working on a small and personal project that is already

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.