Objective-c中使用连接符

2017-12-07  本文已影响18人  碧玉小瑕

#define STRING(x) @#x

NSString*conststr1 =STRING(abc;{a; b = c};abc);

NSString*str =STRING(abc);

NSLog(@"str = %@",str);

NSLog(@"str1 = %@",str1);

输出:

2017-12-07 11:39:04.550770+0800 BeautifyFaceDemo[21439:8865890] str = abc

2017-12-07 11:39:04.550830+0800 BeautifyFaceDemo[21439:8865890] str1 = abc;{a; b = c};abc

上一篇下一篇

猜你喜欢

热点阅读