我希望实现与方法相同的功能stringWithFormat.
我想知道你是否可以打电话给我的另一个常数#define?
例如 [NSString stringWithFormat:@"If you enjoyed %@ would you mind please reviewing it?", appName];
我想要:
#define appName @"This App"
#define myMessage @"If you enjoyed **appName** would you mind please reviewing it?"
Run Code Online (Sandbox Code Playgroud)
谢谢
#import <Foundation/Foundation.h>
#define appName @"This App"
#define myMessage @"If you enjoyed " appName @" would you mind please reviewing it?"
int main( void )
{
@autoreleasepool
{
NSLog( myMessage );
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
124 次 |
| 最近记录: |