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
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:
- Create an iPad project coded as a split-view
- create brand new classes and nibs for the iPad
- import iPhone classes and nibs
- Change build/target settings in accordance with Universal Apps
- 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