【问题标题】:Getting xcconfig configuration file name from code从代码中获取 xcconfig 配置文件名
【发布时间】:2016-08-12 21:45:47
【问题描述】:

有没有办法在代码中获取正在使用的 .xcconfig 文件的名称?

如下图我希望能够找出配置是“Lab2”

【问题讨论】:

标签: ios objective-c swift xcode xcconfig


【解决方案1】:

这是一种阅读方式...

编辑您的 Lab2.xcconfig 文件并添加此文件

OTHER_SWIFT_FLAGS = -DLAB2

然后在你的代码中

    #if LAB2
        print("Build using lab2.xcconfig")
    #else
        print("Build using some_other.xcconfig")
    #endif

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-09
    • 1970-01-01
    相关资源
    最近更新 更多