[[NSBundle mainBundle]pathForResource:@"name" ofType:@"type"] 获取不到本地文件
2016-08-01 15:58
323 查看
最近开发,通过[[NSBundle mainBundle]pathForResource:@"name" ofType:@"type"] 方法获取本地文件路径,遇到找不到文件,一直显示nil,之前使用一直是正常的。经检查发现本身操作也是没问题的,因为只是偶尔会出现这个问题,个人感觉应该是xcode的原因
添加资源方式
添加资源,可以用拖拽的形式和右键Add Files to“...”,采用拖拽形式一定要记得勾选Copy items if needed 和targets
找不到文件解决办法
Build Phases -->copy Bundle Resources --> "+"
重新将要加入的文件添加到项目资源文件中,就OK了
添加资源方式
添加资源,可以用拖拽的形式和右键Add Files to“...”,采用拖拽形式一定要记得勾选Copy items if needed 和targets
找不到文件解决办法
Build Phases -->copy Bundle Resources --> "+"
重新将要加入的文件添加到项目资源文件中,就OK了
相关文章推荐
- iOS [[NSBundle mainBundle] pathForResource:@"" ofType:@""]无法获取到文件
- 关于[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]找不到指定文件的解决办法
- 关于[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]找不到指定文件的解决办法
- 关于[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]找不到指定文件的解决办法
- [[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"] 找不到对应的文件解决方法
- 关于[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]找不到指定文件的解决办法
- 关于[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]找不到指定文件的解决办法
- [NSBundle mainBundle] pathForResource: ofType: 获取不到数据
- [NSBundle mainBundle] pathForResource: ofType: 获取不到数据
- iOS问题笔记-[[NSBundle mainBundle] pathForResource: ofType:]方法获取不到资源路径
- [[NSBundle mainBundle]pathForResource:@"XXX" ofType:@"db"]为nil的解决办法
- iOS开发中 [[NSBundle mainBundle] pathForResource: ofType:]路径为空的问题
- 关于[[NSBundle mainBundle] pathForResource:@"name"
- NSBundle的pathForResource:ofType: 返回值为nil问题
- iOS开发 [NSBundle mainBundle] 通过pathForResource返回路径为空.
- [[NSBundle mainBundle]pathForResource..取值为空
- iOS开发.[NSBundle mainBundle] 通过pathForResource返回路径为空.
- [[NSBundle mainBundle]pathForResource..取值为空
- NSBundle mainBundle] pathForResource 返回nil的解决办法
- Description Resource Path Location Type The value of attribute "schema" associated with an element t