Building a Universal iPad App - Where is the device recognition code?

Posted by JustinXXVII on Stack Overflow See other posts from Stack Overflow or by JustinXXVII
Published on 2010-04-07T13:31:31Z Indexed on 2010/04/07 13:33 UTC
Read the original article Hit count: 448

Filed under:
|
|

I noticed that when I create a new project in XCode for a Universal iPad/iPhone application, the template comes with two separate App Delegate files, one for each device. I can't seem to locate the place in code where it tries to decide which app delegate to use.

I have an existing iPhone project I'd like to port to iPad. My thinking was that if I went ahead and designed the iPad project, I could just import my iPhone classes and nibs, and then use the App Delegate and UIDevice to decide which MainWindow.xib to load. The process went like this:

  1. Create an iPad project coded as a split-view
  2. create brand new classes and nibs for the iPad
  3. import iPhone classes and nibs
  4. Change build/target settings in accordance with Universal Apps
  5. Use [[UIDevice currentDevice] model] in the AppDelegate to decide which MainWindow to load

Will this work, or does the app just automatically know which device it's being deployed on?

Thanks for any insight you can offer.

© Stack Overflow or respective owner

Related posts about ipad

Related posts about iphone