The file couldn’t be opened because you don’t have permission to view it

ⅰ亾dé卋堺 提交于 2019-12-20 02:00:30

问题


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

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