开发者

XCODE: Access Data From full_settings.xcconfig from the Source Code

I need to access the data from my xcode project's full_settings.xcconfig file. I was hoping to access the data from it like constants or something and use it in my iOS project. Is that possible? How do I do that?

Here is what the full_settings.xcconfig contains:

PF_BUILD_VERSION = 1.0.0.0
PF_ITUNES_ARTWORK = full_iphone/iTunesArtwork
PRODUCT_NAME = UHu
PF_BUNDLE_ID = com.uhu.uhu
PF_USE_PROCESSED_ASSETS 开发者_运维百科= 1

As you may have guessed. I would like to track the version and id of my program according to this document. How do I do that? Or is there an alternative way of tracking the version and id?

Thank you!


You can use your defined variables in your Info.plist file using a dollar sign, e.g.:

${PF_BUILD_VERSION}

Then you need to link the xcconfig to your project. In XCode 4.2, you do this in the project info under configurations.

1) Click on the project at the top of the Project navigator. 2) Click on the Project above the Target at the left of the middle pane. 3) Expand a configuration and select the config file. 4) Repeat for other configurations.

Matt

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜