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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:46:46+00:00 2026-06-14T09:46:46+00:00

When I first started programming for iOS (with Cocos2d) I used a bunch of

  • 0

When I first started programming for iOS (with Cocos2d) I used a bunch of hardcoded coordinates based on 320×480 screen size for the iPhone. I just realized that I need to include at least a basic version of iPad and the iPad mini.

I have read these:

cocos2d (but i’m not sure if this is the best way?)
cocos2d:Convert iPhone App to Universal App

converting coordinates:
Convert coordinates from iPhone screen size to iPad screen size

converting iphone to ipad:
http://iphonedevelopment.blogspot.com/2010/04/converting-iphone-apps-to-universal.html

Apple’s documentation on creating universal app:
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW24

  1. is there an easy way to convert the graphical display from iPhone to iPad without editing every part of my code where I used a hard coded value? (50 spots, all in 1 file)
  2. what’s the best practice for future coding with iOS/Cocos2D coordinates? should I do

    #define SPACE_SHIP_X_IPAD 384

    #define SPACE_SHIP_X_IPHONE 160

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){

    `[ship.setPosition ccp:(SPACE_SHIP_X_IPHONE,0)];`
    

    } else {

    `[ship.setPosition ccp:(SPACE_SHIP_X_IPAD,0)];`
    

    }

    (by the way, will someone who knows how to format this code with the “#” sign, plz teach me how to format the above code?)

  3. is it recommended that I create 2 different apps – one for iphone and one for iPad? or this universal approach of only 1 app, and then selecting the distribution type when I submit to Appstore?

  4. are Mac versions of apps the same distribution channel as the app store for iPhone and iPad? what are the advantages or disadvantages to distributing on Mac as well? (i’m guessing it’s not good because graphics would have to accomodate something liek the massive iMac?)
  5. just to make sure – my app file (which doesn’t use anything iphone specific like calling) will work on the iPod and iPad Mini without ANY extra work, right?

Any help would be greatly appreciated. I will upvote all good attempts

  • 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-14T09:46:48+00:00Added an answer on June 14, 2026 at 9:46 am

    It looks like your approach is overly complicated. Making a universal application typically involves never hard-coding position values, but rather calculating these position values based on the bounds of the device.

    For example:

    //Button in center for universal
    CGPoint buttonOffset = CGPointMake( ([[UIScreen mainScreen] bounds].size.width - button.frame.size.width) / 2, ([[UIScreen mainScreen] bounds].size.height - button.frame.size.height) / 2);
    
    button.frame = CGRectMake(buttonOffset.x, buttonOffset.y, button.frame.size.width, button.frame.size.height);
    

    Use similar concepts to create buttons (or ships) with positions that are relative to the screen bounds. This will save you a lot of time and grief.

    One thing to note is that the “bounds” of the screen will not factor in the device orientation. If you want to support multiple orientations you will find it useful to create a utility method to handle that logic for you.

    Something like:

    + (CGSize) deviceSize {
        CGSize size;
        if(UIDeviceOrientationIsLandscape([[UIDevice currentDevice] orientation])){
            size = CGSizeMake([[UIScreen mainScreen] bounds].size.height, [[UIScreen mainScreen] bounds].size.width);
        } else {
            size = CGSizeMake([[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height);        
        }
        return size;
    }
    

    I know you want an easy solution so you don’t have to change all your values but I would recommend biting the bullet and changing the values. It will help you a lot in the long-run. Not only for this application but the practice will help in any application you create in the future.

    Is it recommended that you create two different apps for universal? No, it is not recommended. You can select “universal” when creating the xcode project and also change it in an existing project. You will not need to create two builds or binaries either. Apple will recognize it as universal and make it available in the store for all devices. However, you will need to create multiple versions of a splash screen to accommodate different screen sizes and pixel densities.

    are Mac versions of apps the same distribution channel as the app store for iPhone and iPad? Sort of… you can deploy to the app store and you gain more freedom since you can package and distribute the OSX binary yourself — but you will have to create a separate app since you will most likely be using CocoaTouch libraries which are not supported on the mac. You will want to preserve functionality that does not use CocoaTouch such as your Rendering and Game Logic. If you are deploying to OSX, the large screen sizes will be the least of your concern. Advantages: Wider Audience. Disadvantages: Requires a lot of planning when architecting your app/game so you can reuse as much code as possible and cater to all screens.

    just to make sure – my app file (which doesn’t use anything iphone specific like calling) will work on the iPod and iPad Mini without ANY extra work, right? Well… some extra work With some additional image assets for home screen icons and a splash screen you will be good to go.

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

Sidebar

Related Questions

First, I'm new to iOS and Objective-C programming (I started a month ago). I'm
I have just started the Assembly language programming and in the first lecture our
Well, I've started with iPod/iPhone programming using Head First iPhone Development (O'reilly) and I'm
I've just started programming a online highscore for the first time, and it's for
When I first started programming in .NET I used try/catches all the time. I
I just started to learn iOS programming and I have a problem with inheritance.
I just started to learn iOS programming and I have a problem with inheritance.
I just started learning my first real programming language, Python. I'd like to know
When I first started programming I always followed the convention of defining global variables
When I first started with Javascript, I usually just put whatever I needed into

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.