Combining iPhone/iPad apps into one universal app

核能气质少年 提交于 2019-12-08 03:05:40

问题


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:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/2704148/combining-iphone-ipad-apps-into-one-universal-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!