简体   繁体   English

如何使我的应用通用?

[英]How to make my app universal?

I am trying to make my app universal and for both IOS 8 IOS 7. This macros work perfectly in IOS Simulator but when I try to open it in IOS 7.1 simulator pups up this message in Xcode 6.1 Below is the image. 我正在尝试使我的应用程序同时适用于IOS 8 IOS 7和IOS7。此宏在IOS Simulator中可以正常工作,但是当我尝试在IOS 7.1 Simulator中打开它时,会在Xcode 6.1中添加此消息。下图是图像。 在此处输入图片说明

I have this macros: 我有这个宏:

#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) // iPhone and       iPod touch style UI

#define IS_IPHONE_5_IOS7 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 568.0f)
#define IS_IPHONE_6_IOS7 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 667.0f)
#define IS_IPHONE_6P_IOS7 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height == 736.0f)
#define IS_IPHONE_4_AND_OLDER_IOS7 (IS_IPHONE && [[UIScreen mainScreen] bounds].size.height < 568.0f)

#define IS_IPHONE_5_IOS8 (IS_IPHONE && ([[UIScreen mainScreen] nativeBounds].size.height/[[UIScreen mainScreen] nativeScale]) == 568.0f)
#define IS_IPHONE_6_IOS8 (IS_IPHONE && ([[UIScreen mainScreen] nativeBounds].size.height/[[UIScreen mainScreen] nativeScale]) == 667.0f)
#define IS_IPHONE_6P_IOS8 (IS_IPHONE && ([[UIScreen mainScreen] nativeBounds].size.height/[[UIScreen mainScreen] nativeScale]) == 736.0f)
#define IS_IPHONE_4_AND_OLDER_IOS8 (IS_IPHONE && ([[UIScreen mainScreen] nativeBounds].size.height/[[UIScreen mainScreen] nativeScale]) < 568.0f)

#define IS_IPHONE_5 ( ( [ [ UIScreen mainScreen ] respondsToSelector: @selector( nativeBounds ) ] ) ? IS_IPHONE_5_IOS8 : IS_IPHONE_5_IOS7 )
#define IS_IPHONE_6 ( ( [ [ UIScreen mainScreen ] respondsToSelector: @selector( nativeBounds ) ] ) ? IS_IPHONE_6_IOS8 : IS_IPHONE_6_IOS7 )
#define IS_IPHONE_6P ( ( [ [ UIScreen mainScreen ] respondsToSelector: @selector( nativeBounds ) ] ) ? IS_IPHONE_6P_IOS8 : IS_IPHONE_6P_IOS7 )
#define IS_IPHONE_4_AND_OLDER ( ( [ [ UIScreen mainScreen ] respondsToSelector: @selector( nativeBounds ) ] ) ? IS_IPHONE_4_AND_OLDER_IOS8 : IS_IPHONE_4_AND_OLDER_IOS7 )

How do I solve this problem? 我该如何解决这个问题?

Probably the 7.1 simulator is not installed on your computer (it is not installed by default). 您的计算机上可能未安装7.1仿真器(默认情况下未安装)。 Inside Preferences > Downloads see whether it's installed under Components. 在“首选项”>“下载”中,查看它是否已安装在“组件”下。

在此处输入图片说明

What you are describing as problematic here is not your app's role as a universal app (which means that it is native on iPhone and iPad - that part is working just fine) but as an app that is permitted to run on a system older than its base SDK. 您在这里描述的问题不是您的应用程序作为通用应用程序的角色(这意味着它在iPhone和iPad上是本机的-这部分工作正常),而是作为可以在比其旧版本运行的系统上运行的应用程序基本SDK。

Simply set the deployment target. 只需设置部署目标。 The easiest way is by editing the project - see the Deployment Target pop-up on the Info tab. 最简单的方法是编辑项目-请参阅“信息”选项卡上的“部署目标”弹出窗口。

在此处输入图片说明

In that screen shot, the deployment target is 8.1, which means we can't even run on iOS 8, let alone iOS 7! 在该屏幕截图中,部署目标是8.1,这意味着我们甚至无法在iOS 8上运行,更不用说iOS 7了! By setting it to, say, 7.0, you would permit use as far back as iOS 7.0. 通过将其设置为7.0,您可以允许使用早于iOS 7.0的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM