问题
I can't understand why it does not enter into the if control. Anyone knows explain to me?
- (void)verifyapp{
NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];
NSLog(@"%@", receiptURL);
//CONTROLLO SE ESISTE
if ([[NSFileManager defaultManager] fileExistsAtPath:receiptURL.path]) {
}
}
回答1:
Receipt only exist if you install app from the AppStore. If you install it from the XCode Debug mode, it will not have a receipt. To debug your code you need to install app from AppStore first, launch it and install app from XCode above it.
来源:https://stackoverflow.com/questions/24591415/appstorereceipturl-error