将iPhone / iPad应用程序组合到一个通用应用程序中

编程入门 行业动态 更新时间:2024-10-25 04:15:48
本文介绍了将iPhone / iPad应用程序组合到一个通用应用程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有两个应用程序(一个用于iPhone,另一个用于iPad),我想将它们合并到一个通用应用程序中。对于我的第一次尝试,我尝试创建一个新的通用应用程序项目,并为iPhone和iPad版本添加了库。 iPad版本已编译并运行正常(如预期),但iPhone版本没有。我的希望是我可以创建一个通用应用程序,在iPhone上运行时只执行iPhone库中的项目,反之亦然执行iPad。

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.

看起来像这应该仍然有效。有没有办法告诉通用应用程序项目在编译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?

谢谢!

推荐答案

在通用应用程序中,只有一个二进制文件。你没有为iPad编译,反之亦然。两个设备都运行相同的代码。所有关于做什么和加载什么的决定都必须在运行时做出。

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.

更多推荐

将iPhone / iPad应用程序组合到一个通用应用程序中

本文发布于:2023-11-15 16:35:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1596135.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   组合   iPhone   iPad

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!