问题
imageData=[NSData dataWithContentsOfURL:self.pdfFileUrl options:NSDataReadingMappedAlways error:&error];
NSLog(@"%@",[error localizedDescription]);
NSLog(@"%@",imageData);
in above code I get the error "The file “bg.png” couldn’t be opened because you don’t have permission to view it."
I can't convert bg.png file to NSData.
回答1:
I encountered the same problem. What I did was to go to Build Options. Then I changed the value of the "Compiler for C/C++/Objective-C" to Default Compiler. Its work fine for me
来源:https://stackoverflow.com/questions/23774731/the-file-couldn-t-be-opened-because-you-don-t-have-permission-to-view-it