appStoreReceiptURL Error

a 夏天 提交于 2019-12-11 20:14:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!