iOS报错总结(持续更新)

1、this class is not key value coding-compliant for the key XXX错误

运行时遇到了" this class is not key value coding-compliant for the key digitPressed.' "的错误,经过一番搜索和排查发现是自己在设置IBAction和IBOutlet时有多余的连线,按下ctrl键检查控件的连接将多余的连续删除后程序正常运行

2、EXC_BAD_ACCESS

(1)UIKit

原因:此代码在NSNotification的返回方法中,需要放入主线程执行


3、ignoring file XXX, missing required architecture i386 in file

(1)使用64-bit模拟器运行(缺少32位(i386架构)的库)

(2)查看Build Settings - Library Search Paths路径设置

(3)重新加载Build Phases - Link binary with libraries中的文件

今天编译遇到这样的报错

ld: warning: ignoring file /mydoc/code/Temp/KMDemo/Security.framework/Security, missing required architecture i386 in file


然后后面跟了一片error,比方说

 "_kCFStreamSSLAllowsExpiredRoots", referenced from:

     -[GCDAsyncSocket maybeStartTLS] in GCDAsyncSocket.o


很奇怪,明明已经添加了framework了,为什么还出错?

网上搜索了若干解决方法,最后找到了适用于我的解决方法:在finder中打开我的工程目录,在其中找到CFNetwork.framework,删除,然后重新编译,即通过。

回想了一下为什么出问题的原因:我的framework是由另一个工程拖动进该工程的,拖动过程中习惯性的选择了这样的界面


在Destination下,即我将该库文件页拷贝进了我的工程目录,再编译的时候造成了该错误。

 

毕竟已经搜索了很久了,干脆将网上提到的其它可能产生该错误的原因都罗列下:

1、在程序工程目录下存在相同的framework,影响到了系统的编译过程,导致framework加入,但是编译的时候没有进行编译。比如我就是该原因导致的错误。

详细信息:

For some reason, my application will install and run fine on my device, but when I try to install my application on the iPhone Simulator, I get these warnings:

ld: warning:in/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/Frameworks/UIKit.framework/UIKit, missing required architecture i386 in file

The Answer is:

1) The Base SDK should be Device

2) iPhone SDK Frameworks were copied into your project directory (on disk). Open your project directory and remove any standard iPhone SDK Frameworks.

3) Clean Caches and Rebuild

原帖地址:http://hi.baidu.com/cosmicdreamer/item/2cae3cc3421ee2bc0d0a7b1f

2、工程路径设置出错

解决方法:删除掉Targets-Build Settings-Library Search Paths中的内容

我查看了我的工程下的该位置默认就是空的,想来这种情况多会出现在下载的外部DEMO可能进行过该设置

3、证书签名问题

具体解决方法帖子中没有提到,只在这里罗列一下。

原帖地址:http://www.cocoachina.com/bbs/read.php?tid=78890&page=1

4、运行模拟器出错

解决方法:将run按钮旁边的运行调整为Device方式


原帖地址:http://blog.couldhll.com/2011/11/16/missing-required-architecture-i386-in-file/

我当前的环境还没有设置证书,因此如果我在该环境下编译,会报错如下,因此无法验证正确性:

Code Sign error: There are no valid certificate/private key pairs in the default keychain



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值