IOS常见错误分析解决(一直更新) 你值得收藏-综合贴

-来自收藏总结 综合了好多的常见错误

1:clang failed with exit code 254

 一:检测代码中 是否 有 NSLog 打印了 返回 void 的值.


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


一:将出错的png,用PhotoShop重新转换一次,  如果PhotoShop打不开,改后缀为Jpg 试试. 转换时,请使用 :存储为Web或设备所使用的格式格式转换成 PNG-24这样的图片大小比较合适


3:

一:确定静态库中是否有自定义的类文件,如果一个也没有,就会出现这种错误,这也是为什么新建的静态库都包含一个默认的类.

4:  _OBJC_CLASS_$_UIMainKpiXML", referenced from:

1:检测类文件是否已经指定了Project Target 


2:检测类文件是否在Bulid Phases 中的 Compile Source 是否包含了这个类文件


以上两步都检查完成以后,如果编译还报错误,请尝试彻底关闭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或者静态库的工程中依旧编译时,可能是以下设置导致,设置为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:检测同一个静态库或工程中是否有两个或以上的想同类文件存在

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

工程使用的编译器版本过低所致. 修改编译器版本至最新版本,如下图:


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



16.解决真机调试iPad Air设备时的错误:architecture not supported的办法

1.将Build Settings 中Architectures ——> Valid Architectures的arm64删掉,只留armv7、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常见错误分析


本文一直更新希望大家踊跃回复自己知道的常见error  来参与本文的更新^_^


IOS常见错误分析解决(一直更新) 你值得收藏-综合贴,,5-wow.com

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。