在Xcode的BuldSetting中有Preprocessor Macros选项,看名知意,在这里可以预定义项目宏定义,像这样。
这里在写的时候是不建议像这种写法的
通常会使用宏定义作这样的代码判断
#ifdef DEBUG
verifyReceiptURL = [[[NSURL alloc] initWithString:@"https://sandbox.itunes.apple.com/verifyXXXt"] autorelease];
#else
verifyReceiptURL = [[[NSURL alloc] initWithString:@"https://buy.itunes.apple.com/verifyXXX"] autorelease];
#endif
这里在写的时候是不建议像这种写法的
if (DEBUG) {
verifyReceiptURL = [[[NSURL alloc] initWithString:@"https://sandbox.itunes.apple.com/verifyReceipt"] autorelease];
} else {
verifyReceiptURL = [[[NSURL alloc] initWithStr