iOS中常见错误
2015-10-23 09:54
543 查看
1.当我们在定义一个新的属性时,用到了new、copy这些字时会报错:Property follows Cocoa naming convention for returning'owned' objects
原因是苹果在新的编码时,不推荐以new、copy开头的命名
解决办法是换个命名,哈哈~
error: could not read data from '/Users/sf_gxd/Desktop/Gasake/Gasake/Gasake-Info.plist': The file “Gasake-Info.plist” couldn’t be opened because there is no
such file.
2、prefix.pch文件路径错误
clang: error: no such file or directory: '/Users/sf_gxd/Desktop/Gasake/Gasake/Gasake-Prefix.pch'
clang: error: no input files
修改如下所示
情景2.如果已经删除单元测试相关文件,则是删的不够彻底,把单元测试的target也删掉就OK了。
原因是苹果在新的编码时,不推荐以new、copy开头的命名
解决办法是换个命名,哈哈~
2.Info.plist与Prefix.pch修改文件位置遇到的问题及解决方法
如果要更改Info.plist与Prefix.pch文件实际路径,也就是实际文件的位置(不是在工程中的组织路径),需要到Build Settings中修改对应的配置,不然工程就找不到对应的Info.plist与Prefix.pch文件。报错情况:
1、Info.plist文件路径错误error: could not read data from '/Users/sf_gxd/Desktop/Gasake/Gasake/Gasake-Info.plist': The file “Gasake-Info.plist” couldn’t be opened because there is no
such file.
2、prefix.pch文件路径错误
clang: error: no such file or directory: '/Users/sf_gxd/Desktop/Gasake/Gasake/Gasake-Prefix.pch'
clang: error: no input files
解决方案:
将路径按照自己工程修改正确,Clean一下,然后运行即可。修改如下所示
3.The file “Info.plist” couldn’t be opened because there is
no such file
修改了Info.plist的实际文件位置(项目和单元测试对应不同的Info.plist),报错
(null): could not read data from '/Users/xxxxx/Desktop/gsk/zhsy/zhsy/Info.plist': The file “Info.plist” couldn’t be opened because there is no such file.解决办法
情景1.如果有单元测试,那就设置一下单元测试target的info,与项目target不是一个路径。情景2.如果已经删除单元测试相关文件,则是删的不够彻底,把单元测试的target也删掉就OK了。
相关文章推荐
- iOS实现一个颜色渐变的弧形进度条
- AFNetworking 3.0迁移指南
- iOS上传错误 ERROR ITMS-90049
- 编译opencore-amr for iOS8并支持bitcode
- IOS9 KeyWindow为空的问题
- iOS用户首选项NSUserDefaults浅析
- AFNetworking 3.0迁移指南
- 芒果iOS开发sizeof和strlen的区别
- 整理iOS9适配中出现的坑(图文)
- duplicate symbols for architecture i386/x86_64解决办法
- 零基础ios开发(二 关联button 实现图片的上下左右移动)
- 《iOS总结》上传报错:ERROR ITMS-90049
- iOS 9 适配中出现的坑
- iOS7 状态栏 修改为白色字体的步骤
- iOS引导页不滑动N秒自动跳转的实现
- IOS开发常用的正则表达式
- 程序编译成功之后立即退出来,显示Thread1:breakpoint 3.1
- iOS实战:第三方登陆weibo/weixin/qq集成
- iOS实战:第一次在iTunesConnect上建立应用时注意公司名称
- 蜂窝教育: ios培训机构成人才聚集地