Preprocessor macro value to Objective-C string literal

前端 未结 4 656
礼貌的吻别
礼貌的吻别 2021-02-01 04:18

I have a preprocessor macro defined in build settings

FOO=BAR

That value I want to massage into an Objective-C string literal that can be passe

4条回答
  •  深忆病人
    2021-02-01 04:54

    You need to define preprocessor macro like,

    FOO=\@\"BAR\"
    

    And use code side like,

    [NSString stringWithFormat:@"macro: %@", FOO];
    

提交回复
热议问题