views:

1084

answers:

2

I have two apps (one for the iPhone, the other for the iPad) that I'd like to combine into one universal app. For my first attempt, I tried creating a new universal app project and added the libraries for the iPhone and iPad versions. The iPad version compiled and ran fine (as expected), but the iPhone version didn't. My hope was that I could create a universal app that would execute only the project in the iPhone library when running on the iPhone and vice versa for the iPad.

It seems like this should still work. Is there a way to tell the universal app project to ignore one of the external libraries when compiling for the iPad and vice versa for the iPhone?

Thanks!

+1  A: 

In a universal app there is only one binary. You do not "compile for the iPad and vice versa for the iPhone". Both device run the same code. All decisions on what to do and what to load have to be made at runtime.

Ole Begemann
Right, I know there's only the one binary. What I meant to say was that I could get it to run using the iPad simulator but not the iPhone one.On a whim, though, I tried placing the xcodeproj file built for the iPad under the iPad directory and the one built for the iPhone under the iPhone directory... and that worked.Ah, I guess I should write about this below...
donkim
+1  A: 

I'm not sure what Apple is going to do when one can develop both iPhone and iPad apps for version 4.0 , but right now, if you want to test in the simulator for either do the following:

  • For testing as an iPhone app set the Simulator to version 3.1.3
  • For testing as an iPad app set the Simulator to version 3.2

This is how XCode/the iPhone Simulator currently determine which simulation to run.

OChomer