Preprocessor macro value to Objective-C string literal

前端 未结 4 666
礼貌的吻别
礼貌的吻别 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:47

    What error are you seeing exactly? This type of thing does work as you expect:

    #define kMyString @"MyString"
    
    [NSString stringWithFormat:@"macro: %@", kMyString];
    

提交回复
热议问题