我刚刚在我的 iTunes 中添加了一个 IAP,并添加了一个测试用户,一切看起来都很好,并且 IAP 已为我的游戏启用。在 Apple Docs 中,它说将此代码放入 AppDelegate
// Locate the receipt
NSString *receiptPath = [[[NSBundle mainBundle] appStoreReceiptURL] path];
// Test whether the receipt is present at the above path
if (![[NSFileManager defaultManager] fileExistsAtPath:receiptPath]) {
NSLog(@"Exit");
// Validation fails
exit(173);
}
我不太明白该代码的意义是什么?当我使用其中的代码运行游戏时,它会立即退出,我做错了什么?