IOS常見錯誤分析解決(一直更新) 你值得收藏-綜合貼

-來自收藏總結 綜合了好多的常見錯誤ios

1:clang failed with exit code 254web

 一:檢測代碼中 是否 有 NSLog 打印了 返回 void 的值.bootstrap


2:Verify exit code of build task with internal identifier 'CopyPNGFile 123.png'xcode


一:將出錯的png,用PhotoShop又一次轉換一次,  假設PhotoShop打不開,改後綴爲Jpg 試試. 轉換時,請使用 :存儲爲Web或設備所使用的格式格式轉換成 PNG-24這種圖片大小比較合適ide


3:ui

一:肯定靜態庫中是否有本身定義的類文件,假設一個也沒有,就會出現這樣的錯誤,這也是爲何新建的靜態庫都包括一個默認的類.this

4:  _OBJC_CLASS_$_UIMainKpiXML", referenced from:spa

1:檢測類文件是否已經指定了Project Target .net


2:檢測類文件是否在Bulid Phases 中的 Compile Source 是否包括了這個類文件debug


以上兩步都檢查完畢之後,假設編譯還報錯誤,請嘗試完全關閉XCode  再次編譯試試.

5: for architecture armv7s



下面摘自: http://stackoverflow.com/questions/12570116/what-is-the-difference-between-arm7-and-arm7s

Yes you are right about armv7s is about the iPhone 5. Here some summary info I found on the web:

  • ARMv6 ISA (used by the ARM11 core in the iPhone 2G and iPhone 3G)
  • ARMv7 (used by modern ARM cores, iPhone 3GS, iPhone 4 and 4S)
  • ARMv7s (new A6 SoC for iPhone 5).

注:錯誤含義表示 指定的framework 不支持對 armv7s 的支持, 也就不支持搭載A6處理器的iPhone 5. 

假設在編譯framework或者靜態庫的project中依然編譯時,多是下面設置致使,設置爲NO就能夠



6: Local declaration of '' hides instance variable

1:私有變量與屬性變量同名所致


7:Instance variable '' accessed in class method


1:在靜態方法不能使用到類的屬性變量,不然就報上面的錯誤

8:ld: symbol(s) not found for architecture i386


1:裏面意思說:"_stroyboard" 這個屬性在目標類中 根本就沒聲明!


那就聲明一下咯?

注:XCode4.5 會默認聲明瞭,但是僅僅是針對本身定義類,系統類尚未. 因此,當心


  1. @synthesize storyboard;  

9:PerformSelector may cause a leak because its selector is unknown   

經過例如如下代碼解決產生的編譯器警告


  1. #pragma clang diagnostic push
  2. #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
  3.     [self performSelector:nextView];  
  4. #pragma clang diagnostic pop

來源:( http://www.ooso.net/archives/620 )

10:unable to open executable

1:檢測同一個靜態庫或project中是否有兩個或以上的想同類文件存在

2:刪除模擬器中的應用,刪除DerivedData目錄 又一次啓動XCode.


11: Property's synthesized getter follows Cocoa naming convention for returning 'owned' objects

不要在頭文件聲明變量命名是以new copy開頭

參考:http://kongbei888.blog.163.com/blog/static/24326613201261902510652/


12:ld: file not found:

1:指向的靜態庫沒有找到



14: _utf8_countTrailBytes

add library libicucore.dylib


15:Stray "@"  in program

project使用的編譯器版本號太低所致. 改動編譯器版本號至最新版本號,例如如下圖:


參考:http://stackoverflow.com/questions/12821938/stray-in-program-with-nsdictionary-definition



16.解決真機調試iPad Air設備時的錯誤:architecture not supported的辦法

1.將Build Settings 中Architectures ——> Valid Architectures的arm64刪掉。僅僅留armv七、armv7s

2.同上。將Architectures ——>Architectures改成 $(ARHS_STANDARD)armv7。armv7s

3.把Build Active Architecture Only 改成NO

4.編譯就能夠

17.編譯時出現:Not supported ARM architecture

解決的方法:在./configure 時增長 -D__ARM_ARCH_5TEJ__

另一篇:Android常見錯誤分析

18.Couldn't register xxx.xx.xx with the bootstrap server. Error: unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.
每個在xcode下用ios模擬器作開發的開發人員都應該會遇到過上面所看到的的錯誤。眼下找到最行之有效的解決的方法是從新啓動手機。

不行了也順便把電腦從新啓動下。

建議之後記得stop便可了 不要正執行着就直接卸載了程序

本文一直更新但願你們踊躍回覆本身知道的常見error  來參與本文的更新^_^

相關文章
相關標籤/搜索