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



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章