常見編輯錯誤匯總

來源:互聯網
上載者:User

標籤:des   style   blog   http   os   使用   io   strong   檔案   

轉載自CSDN --andyweike
1. 編譯iPad真機時,選擇了 Architetures:Standard(armv6) BaseSDK:iPhoneDevice3.2 TargetDeviceFamily:iPad.
若編譯出現如下錯誤:
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
則修改 GCC4.2CodeGeneral地區中的ComplieForThumb為非選中.
已經有了開發人員認證及私密金鑰後,可直接在越獄的手機上調試.
 
2. 編譯連結時, "_OBJC_CLASS_$_xxx", referenced from:可能需要重建立立某個類的檔案.
    或者:選擇項目名,在detail列表中的target列(顯示為一個又圓圈),把這個檔案的複選選中,或者再次選中.以把它加入到這個target裡面來.
 
3.在sdk4.0及以上使用RegexKitLite報‘captureCount‘ was not declared in this scope錯誤,是在非.m檔案中使用了它的原因.
   http://www.cocoachina.com/bbs/read.php?tid=38784&page=e&#a
 
4.there is no sdk with the name or path.
   從網上down的開原始碼,結果啟動並執行時候常出現這樣的錯,並且在deployment中沒有ios deployment target 選項.
   http://blog.aztaru.com/2010/10/05/ios筆記there-is-no-sdk-error/
   嘗試 Project/Edit Active Target/ 及 Set Active SDK功能表項目,來回切換一下Active Configuration。
 
5.常見的EXEC_BAD_ACCESS,EXC_BAD_INSTRUCTION錯誤,一般是因為訪問已經被release的對象造成的。尤其是在一個線程中訪問另外一個線程的autorelease庫中的對象,尤其要注意此類問題。
定位錯誤:
在工程中加入 NSZombieEnabled 環境變數,並設為啟用,則在 EXC_BAD_ACCESS 發生時,XCode 的 Console 會列印出問題描述。雙擊Executables 下的 可執行模組,在快顯視窗中,Variables to be set in the environment,添加 NSZombieEnabled,並設定為 YES,點擊選中複選框啟用此變數。
2011-08-03 15:35:32.334 ShanTouMM[1436:207] *** -[UIButton release]: message sent to deallocated instance 0x5f7fcf0
需要更多的提示來協助定位問題,再加入 MallocStackLogging 來啟用malloc記錄。
在gdb視窗輸入 (格式: shell   malloc_history <id>   <address>)    shell malloc_history 14360x5f7fcf0, 也可以在終端中去運行 就要去掉以上的shell 指令 如 malloc_history <id>   <address>
http://www.cocoachina.com/macdev/objc/2011/0219/2661.html
http://www.cnblogs.com/likwo/archive/2011/02/10/1950664.html
應該僅當需要調試記憶體時,才設定上述環境變數.
 
6.運行一個IPhone程式時,快顯視窗說“程式運行失敗,預置描述檔案已到期” 。 解決辦法是,在Xcode中, window-> Orgnazier -> 你的iphone ->刪除帶有紅*的該程式之前的Profile 。 然後從Xcode運行該程式.
7. 真機編譯時間報 Code Sign error: The identity doesn‘t match any valid certificate/private key pair in the default keychain
    修改工程和Targets的get info\build 中的code signing identity為空白

8.調試列印
   CFShow(coreFoundationThingy) will print out a description of coreFoundationThingy to the console. Output looks something like: {value = w:1186.000000 h:687.000000 type = kAXValueCGSizeType}   If NSLog() is printing something out as an NSCFType, try CFShow().
 
9. 編譯時間報 Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1,修改C/C++ Compiler Version為gcc4.2

10.this class is not key value coding-compliant for the key viewController
可能在建立了一個基於view的工程,而後把產生的viewcontroller刪除了,但是在.xib中還有對它的引用,在IB中直接用delete鍵刪除掉它就行了。

11.這台電腦上已經存在一個名為“embedded.mobileprovision”的預置檔案,您是否要替換嗎?
http://blog.sina.com.cn/s/blog_6907b67f0100o2vw.html

12.真機調試時報failed to upload *.app
http://hi.baidu.com/_1989/blog/item/9649f49f805f05aec8eaf466.html
http://www.shouyanwang.org/thread-462-1-1.html

 
error: macro names must be identifiers YourProject_prefix.pch 原因: 因為你弄髒了前置處理器宏,在它處於<Multiple Values>的時候修改了它   解決方案: Configiration選擇All Configirations,清空它 然後分別重新定義你的Debug,Release,Distributin前置處理器宏吧     warning: no rule to process file ‘$(PROJECT_DIR)/LoadingView.h‘ of type sourcecode.c.h for architecture armv6 原因: Target裡Compile Sources裡含有標頭檔 了,那裡面不需要標頭檔   解決方案: 從Target裡Compile Sources裡刪除標頭檔     Command /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS Build System Support.xcplugin/Contents/Resources/copypng failed with exit code 1 原因: png影像檔拷貝失敗,看看資訊上面提示Can‘t find哪個檔案,一般都是從檔案系統裡刪除檔案而沒有通過Xcode刪除造成的,Xcode的項目設定檔依然紀錄著這個檔案的引用 解決辦法: 給檔案系統裡增加相應的檔案,或者從Xcode的Groups & Files刪除它,或者從Target的Copy Bundle Resources裡刪除它     Code Sign error: The identity ‘iPhone Developer: Your Name‘ doesn‘t match any valid certificate/private key pair in the default keychain 原因: 簽名錯誤 解決辦法: Target -> Get Info -> Build -> Code Signing -> 修改簽名 記得左上方的Configuration類型要跟當前Build類型對應(Debug, Release, Distribution),否則改了也白改
 
could not create bundle folder for versioned model *.moda(好像是這個尾碼名的這個檔案)
原因:編譯一次會產生一個新的,應該把編譯產生出來的moda檔案都刪了,然後clean下工程,重新build即可

常見編輯錯誤匯總

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.