Objective c 如何定义#中的两个字符串?

Objective c 如何定义#中的两个字符串?,objective-c,c-preprocessor,Objective C,C Preprocessor,我正在使用 #define SITO @"http://localhost:3000" #define MISSING @"http://localhost:3000/photos/large/missing.png" 是否可以动态执行此操作?我是说 #define SITO @"http://localhost:3000" #define MISSING @"<<SITO>>/photos/large/missing.png" #定义SITO@”http://loc

我正在使用

#define SITO @"http://localhost:3000"
#define MISSING @"http://localhost:3000/photos/large/missing.png"
是否可以动态执行此操作?我是说

#define SITO @"http://localhost:3000"
#define MISSING @"<<SITO>>/photos/large/missing.png"
#定义SITO@”http://localhost:3000"
#定义缺失@“/photos/large/MISSING.png”

不允许将一个micro嵌入另一个micro。但是你可以按照@Simon Lee的建议嵌套

使用以下方法

#define SITO @"http://localhost:3000"
#define MISSING @"<<%@>>/photos/large/missing.png"

不允许将一个micro嵌入另一个micro。但是你可以按照@Simon Lee的建议嵌套

使用以下方法

#define SITO @"http://localhost:3000"
#define MISSING @"<<%@>>/photos/large/missing.png"
使用

使用


实际上,您可以根据我的回答进行嵌套定义。:)实际上,您可以根据我的回答进行嵌套定义。:)它起作用了。请记住,你最终会得到@”http://...“@/照片”;这或多或少是一种连接,很有效。请记住,你最终会得到@”http://...“@/照片”;这或多或少是一种连接。
#define MISSING SITO @"/photos/large/missing.png"