I am rewriting the code I use to validate App Store receipts to use ComonCrypto instead of openssl. In my project is a folder named "_MASReceipt" with an example receipt that I got from Apple, called "receipt". When I call the NSURL method
[code]NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];[/code]
I get a URL that appears to be correct: "Contents/_MASReceipt/receipt.
But when I use the URL to open the receipt, for example:
[code]NSError *theError;
NSData *receiptData = [NSData dataWithContentsOfURL: receiptURL options: NSDataReadingMappedAlways error: &theError];[/code]
The NSData pointer is nil and the NSError contains this error:
domain: @"NSCocoaErrorDomain" Code: - 260
Code 260 is a file not found error.
Why cant the URL I get from the mail bundle be used to open the file?