ios – 使用捆绑标识符代替产品捆绑标识符和Xcode 7

前端之家收集整理的这篇文章主要介绍了ios – 使用捆绑标识符代替产品捆绑标识符和Xcode 7前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
升级Xcode 7后,我注意到CFBundleIdentifier已经开始指向Build Settings / Packaging中的Product Bundle Identifier,而不是Info.Plist中的Bundle Identifier.
有什么方法可以改回来吗?或者它只是简单地指向Bundle Identifier,即在Product Bundle Identifier字段中写$(BUNDLE_IDENTIFIER)?

解决方法

您应该将$(PRODUCT_BUNDLE_IDENTIFIER)保留在Info.plist中,并在Build Settings>中设置产品包标识符. Product Bundle Identifier,其值类似于com.mydomain.myappname.

从Xcode 7.0发行说明:

The new build setting Product Bundle Identifier (PRODUCT_BUNDLE_IDENTIFIER) is the recommended place to set the Bundle Identifier for a target. The target’s Info.plist should be configured to use this build setting by referencing it as $(PRODUCT_BUNDLE_IDENTIFIER) in the value for the CFBundleIdentifier key.

Xcode offers to configure this for you when you accept the “Upgrade to recommended settings” project modernization in the issue navigator,unless your target preprocesses its Info.plist file. In that case you will need to configure this setting manually. This change is backwards-compatible to older versions of Xcode.

This change is required to make certain features work,such as On Demand Resources,if your target preprocesses its Info.plist file. (20887827)

猜你在找的iOS相关文章