您的位置:首页 > 移动开发 > IOS开发

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

2015-08-27 16:28 411 查看
内容来源:http://www.2cto.com/kf/201405/299283.html

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

1:clang failed with exit code 254

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

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





一:将出错的png,用PhotoShZ喎�"http://www.2cto.com/kf/ware/vc/" target="_blank" class="keylink">vcNbY0MLXqru70ru0ziwgIMjnuftQaG90b1Nob3C08rK7v6osuMS689e6zqpKcGcgytTK1C4g16q7u8qxLMfryrnTwyA6PHN0cm9uZz605rSizqpXZWK78snosbjL+cq508O1xCYjMjY2ODQ7yr08L3N0cm9uZz4mIzI2Njg0O8q916q7u7PJPHN0cm9uZz4gUE5HLTI0PC9zdHJvbmc+1eLR+bXEzbzGrLTz0KGxyL3Pus/KyjwvcD4KPHA+Cjxicj4KPC9wPgo8cD4KPHN0cm9uZz4zOjwvc3Ryb25nPjwvcD4KPHA+CjxpbWcgc3JjPQ=="http://www.2cto.com/uploadfile/2014/0509/20140509112551421.png"
alt="\">


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

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 会默认声明了,但是只是针对自定义类,系统类还没有. 所以,小心

@synthesize storyboard; 

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

通过如下代码解决产生的编译器警告

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[self performSelector:nextView];
#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常见错误分析

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 来参与本文的更新^_^
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: