简体   繁体   English

对不同的iOS版本使用不同的Info.plist文件吗?

[英]Use different Info.plist file for different iOS versions?

I would like to use 2 diffrent Info.plist files - one for iOS 8 and another one for iOS 9. Is it possible? 我想使用2个不同的Info.plist文件-一个用于iOS 8,另一个用于iOS9。可以吗?

Specifically, I would like to set plist value of RequestsOpenAccess under NSExtensionAttributes to true on iOS 8 and to false on iOS 9. How can I do that? 具体来说,我想的plist中值设置RequestsOpenAccessNSExtensionAttributestrue在iOS 8,并以falseiOS 9.如何能做到这一点?

Please note: While questions asking for the same exists answers generally recommend using mechanism other than plist to differenciate between versions. 请注意:虽然要求相同的问题也存在答案,但通常建议使用plist以外的机制来区分版本。 I do not think that could be applied in my case (I would be happy if somebody proves me wrong). 我认为这不适用于我的情况(如果有人证明我错了,我会很高兴)。

No, it's not possible. 不,不可能。 You would have to build and distribute two separate apps, as @Dschee says in his comment. 正如@Dschee在他的评论中所说,您将不得不构建和分发两个单独的应用程序。

What about you configure your target to one of the two (say iOS 9 ), then duplicate it , change the second target up to use iOS 8 and also change its Info.plist file path in the build settings? 您如何将目标配置为两个目标之一 (例如iOS 9 ),然后复制它 ,将第二个目标更改为使用iOS 8并在构建设置中更改其Info.plist文件路径

This way you can configure two separate .plist files for two separate targets. 这样,您可以为两个单独的目标配置两个单独的.plist文件。 You would then also need to deploy two separate apps though. 然后,您还需要部署两个单独的应用程序

Would this solve your problem? 这样可以解决您的问题吗?

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

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