iOS开发 [NSBundle mainBundle] 通过pathForResource返回路径为空.
来源:互联网 发布:linux pl文件 编辑:程序博客网 时间:2024/06/09 23:38
先说说今天让我头疼了这么久的这个问题,简简单单的一个从相对路径读取plist文件,居然死活拿不到他的路径。
开始百度了一会,大多数都说,在Targets -> Build Phases -> Copy Bundle Resources里面没有导入资源文件,亦或是导入了,但是你删了,再重新导入,clean一下就OK了,有很多网友是这么解决了。
然后我试了N次,换用各种姿势导入,重新导入,重启Xcode,就差重启电脑了。后来想着,google一下吧。
看到两个关于这个问题stackOverflow里面的解决方案,也大同小异。硬着头皮一直往下看,看到了这么个回答:
就是不要在Release模式下面运行。我转念一想,我现在做的版本迭代,好像以前就是Release模式下的,瞬间如梦初醒。
有些时候,遇到的莫名的问题,其实很简单,但是没有前人趟过这个坑的话,打死我也不会想到是这个原因导致。困扰了大半天的问题就这么解决了,谨以此文,mark一下,也许会有和我一样惨的哥们呢?
阅读全文
0 0
- iOS开发.[NSBundle mainBundle] 通过pathForResource返回路径为空.
- iOS开发.[NSBundle mainBundle] 通过pathForResource返回路径为空.
- iOS开发 [NSBundle mainBundle] 通过pathForResource返回路径为空.
- iOS开发中 [[NSBundle mainBundle] pathForResource: ofType:]路径为空的问题
- [[NSBundle mainBundle]pathForResource..取值为空
- [[NSBundle mainBundle]pathForResource..取值为空
- NSBundle mainBundle] pathForResource 返回nil的解决办法
- IOS pathForResource 返回为空
- iOS问题笔记-[[NSBundle mainBundle] pathForResource: ofType:]方法获取不到资源路径
- [[NSBundle mainBundle]pathForResource:@"XXX" ofType:@"db"]为nil的解决办法
- ios pathForResource: 返回空解决
- [NSBundle mainBundle] pathForResource: ofType: 获取不到数据
- [NSBundle mainBundle] pathForResource: ofType: 获取不到数据
- IOS开发之 [[NSBundle mainBundle] infoDictionary]
- NSBundle MainBundle的路径
- ios pathForResource函数返回空值
- [[NSBundle mainBundle]pathForResource:@"name" ofType:@"type"] 获取不到本地文件
- IOS开发: NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]
- vue.js生命周期钩子函数及缓存
- 字符串转为json格式方法
- 关于maven多模块聚合项目部署等问题--<Jenkins>
- Codeforces Round #420 (Div. 2) E. Okabe and El Psy Kongroo
- C++知识点复习(三)
- iOS开发 [NSBundle mainBundle] 通过pathForResource返回路径为空.
- Android的View坐标系
- Java基础案例----大象划拳PK进入冰箱
- Anker—工作学习笔记
- 九度oj-1059-abc
- ARkit开发
- Html.ActionName的用法
- 亚马逊最高级别华人科学家任小枫加盟阿里
- 多线程测试接口,可显示多次请求最大时间,最小时间