The file cannot be opened because you do not have permission to view

imageData=[NSData dataWithContentsOfURL:self.pdfFileUrl options:NSDataReadingMappedAlways error:&error];
NSLog(@"%@",[error localizedDescription]);
NSLog(@"%@",imageData);

in the above code I get the error message "The file" bg.png "cannot be opened because you do not have permission to view it."

I can not convert the bg.png file to NSData.

+4
source share
1 answer

I ran into the same problem. What I did was go to build settings. Then I changed the value "Compiler for C / C ++ / Objective-C" to the default compiler. His work is beautiful for me

-1
source

Source: https://habr.com/ru/post/1541376/


All Articles