iOS开发.[NSBundle mainBundle] 通过pathForResource返回路径为空.
来源:互联网 发布:小孩学编程 编辑:程序博客网 时间:2024/05/21 13:23
先说说今天让我头疼了这么久的这个问题,简简单单的一个从相对路径读取plist文件,居然死活拿不到他的路径。
开始百度了一会,大多数都说,在Targets -> Build Phases -> Copy Bundle Resources里面没有导入资源文件,亦或是导入了,但是你删了,再重新导入,clean一下就OK了,有很多网友是这么解决了。
然后我试了N次,换用各种姿势导入,重新导入,重启Xcode,就差重启电脑了。后来想着,google一下吧。
看到两个关于这个问题stackOverflow里面的解决方案,也大同小异。硬着头皮一直往下看,看到了这么个回答:
就是不要在Release模式下面运行。我转念一想,我现在做的版本迭代,好像以前就是Release模式下的,瞬间如梦初醒。
有些时候,遇到的莫名的问题,其实很简单,但是没有前人趟过这个坑的话,打死我也不会想到是这个原因导致。困扰了大半天的问题就这么解决了,谨以此文,mark一下,也许会有和我一样惨的哥们呢?
文/宸胤_lcy(简书作者)
原文链接:http://www.jianshu.com/p/90ee7c3adaca
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
原文链接:http://www.jianshu.com/p/90ee7c3adaca
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
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]
- Storyboard/Xib 进阶教程
- 如何修改android工程的包名
- codeforces 519D dp
- 编译VC++6.0时出出现unexpected end of file while looking for precompiled header directived解决方法
- <<web>>漂亮的相册(三)
- iOS开发.[NSBundle mainBundle] 通过pathForResource返回路径为空.
- Did not receive a response to the deployment operation within the allowed timeout period [60 seconds
- maven基础篇(1)-Maven环境变量配置
- 【leetcode】Minimum Window Substring
- iOS 开发中常用编码格式转化
- CentOS shadowsocks-libev多用户管理脚本
- 【实用干货】八条让你相见恨晚的硬道理
- docker常用命令记录
- mysql 创建用户与授权