0

我想达到与您在stringWithFormat方法中相同的效果。

我想知道你是否可以在 my 中调用另一个常量#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?"

谢谢

4

1 回答 1

5
#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;
}
于 2013-09-05T13:21:53.900 回答