ios的一些报错信息或者异常出来,感觉不太清晰,没有java语音的更方便,这里记录一些自己遇到的常见的异常
1:uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 2 beyond bounds [0 .. 1]’ 数组越界
2:野指针错误形式在Xcode中通常表现为:
Thread 1:EXC_BAD_ACCESS(code=EXC_I386_GPFLT)
错误。因为你访问了一块已经不属于你的内存。
http://blog.sina.com.cn/s/blog_a164d0500102vpen.html 页面卡死(eg:字符串拼接,宏定义的一个字符,没有加@); eg:或者属性的修饰符错误
3:objectc unrecognized selector sent to instance 给一个nil的对象发送的消息
3.1 内存泄露,野指针
对象不是nil
Exception: EXC_BAD_ACCESS (code=1, address=0x10)) message sent to deallocated instance 僵尸对象
EXC_BAD_ACCESS(code=1,address=0x0
)
EXC_BAD_ACCESS (code=1, address=0x100)) (block 声明要用copy,不能用assign)
4: 错误信息
+[NSString UDIDString]: unrecognized selector sent to class 0x1048458e0
reason: '+[NSString UDIDString]: unrecognized selector sent to class 0x1048458e0'
原因分析:类只有声明,没有实现
5:
Attempt to dismiss from view controller <ForgetNextViewController: 0x7f7fb3e19370> while a presentation or dismiss is in progress!
this class is not key value coding-compliant for the key view 视图连接的线断了
NSUnknownKeyException this class is not key value coding-compliant for the key (代码和sb的连线有问题,copy的sb)
Error:(15, 46) property follows Cocoa naming convention for returning 'owned’ objects 变量起名字的不能包含任何oc关键字
6:'NSUnknownKeyException', reason: '[<JSONModelArray 0x7f9d8955b470> valueForUndefinedKey:]: this class is not key value coding-compliant for the key @sum.' JSONMOdelArray没有实现kvo就直接闪退了,解决版本缓存NSArray或者NSMutalArray
7: 'NSInternalInconsistencyException', reason: '-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object'
在操作NSDictaionary的时候,出现的错误,
可以见
8:Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '
Storyboard (<UIStoryboard: 0x7ff5c9fa52b0>)
doesn't contain a view controller with identifier 'MyContributeBoxCheckVc''
解决Clean项目,删除Product的生成的app,重新编译,再不行就吧编译后文件全部删除 就好了;
可以参见:
9:failed to get the task for process 6317
真机调试的时候的报错,Edit scheme改成 debug就好了
10: classicHeightForRowAtIndexPath 原因:返回的高度是负数或者是NAN
10: classicHeightForRowAtIndexPath 原因:返回的高度是负数或者是NAN
<a target=_blank href="http://blog.csdn.net/alincexiaohao/article/details/45244523">http://blog.csdn.net/alincexiaohao/article/details/45244523</a>