Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to differentiate iPhone and iPad in universal application?

Tags:

People also ask

Are apps different for iPad and iPhone?

App CompatibilityThe iPad can run any app programmed for the iPad and the iPhone; however, the iPhone can only run apps specifically programmed for the iPhone -- it can't run apps designed for the iPad.

How do I know if my iOS app is universal?

You can check if an app is universal by looking at the app's “download” button within the App Store. If the button contains a “+” within the top-left corner, then the app is universal. Within iTunes, the app's details page will also note that “this app is designed for both iPhone and iPad”.


I want to differentiate the controller for iPhone and iPad.

        #ifdef __IPHONE_NA
            {

            UINavigationBar *ipadNavBar = [[UINavigationBar alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 768.0f, 50.0f)];
            [[self view] addSubview: ipadNavBar];

            UINavigationItem *ipadNavItem = [[UINavigationItem alloc] initWithTitle: @"EMPLOYEE"];
            [ipadNavBar pushNavigationItem:ipadNavItem animated:NO];
            }
    else 
        {

        UINavigationBar *ipadNavBar = [[UINavigationBar alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 360.0f, 45.0f)];
        [[self view] addSubview: ipadNavBar];



UINavigationItem *ipadNavItem = [[UINavigationItem alloc] initWithTitle: @"EMPLOYEE"];
    [ipadNavBar pushNavigationItem:ipadNavItem animated:NO];
    }

if saying error unterminated #ifdef

Is this approach correct?