宏的##和#作用

在宏里面, ##的作用:连接2个标识符

#define method(name) - (void)load##name {}
method(abc)  //- (void)loadabc {}
method(ddd)  //- (void)loadddd {}
method(ttt)  //- (void)loadttt {}

在宏里面, #的作用:给右边的标识符加上双引号""

#define test(name) @#name
test(abc) // @"abc"

你可能感兴趣的:(宏的##和#作用)