static const Vs extern const

前端 未结 7 2063
傲寒
傲寒 2020-12-07 19:34

I have been using static const in my header files as so:

static NSString * const myString = @\"foo\";

But have read that this is not the \'

相关标签:
7条回答
  • 2020-12-07 20:03
    #define myString @"foo"
    

    There is example why:

    You will be able concatenate strings in compile time:

    NSLog(@"%@", @"Say hello to " myString);
    

    will output: Say hello to foo

    0 讨论(0)
提交回复
热议问题