iOS libc++abi.dylib: handler threw exception 错误的解决方案

简单说下背景:最近把工具和SDK都进行了升级Xcode4.5和iOS6,无意之中测出了一个

必现的bug : libc++abi.dylib: handler threw exception。  

libc++abi.dylib: handler threw exception

:  pop    {r4, r5}

以为是升级Xcode或者测试手机(iOS6)而引起的问题,但是仔细查看却不是。

找到错误日志:

*** -[__NSArrayM objectAtIndex:]: index 5 beyond bounds for empty array
(null)
(
	0   CoreFoundation                      0x3867b2bb <redacted> + 186
	1   libobjc.A.dylib                     0x351c797f objc_exception_throw + 30
	2   CoreFoundation                      0x385c6b75 <redacted> + 164
	3   vTurning                            0x0003d18b -[PopularWRController tableView:cellForRowAtIndexPath:] + 462
	4   UIKit                               0x34acb54d <redacted> + 412
	5   UIKit                               0x34ab0313 <redacted> + 1310
	6   UIKit                               0x34ac9c4d <redacted> + 168
	7   UIKit                               0x34aea9a3 <redacted> + 482
	8   UIKit                               0x34af0f39 <redacted> + 224
	9   UIKit                               0x34aa27fd <redacted> + 556
	10  UIKit                               0x34aa2357 <redacted> + 330
	11  UIKit                               0x34aa219b <redacted> + 1474
	12  UIKit                               0x34aed405 <redacted> + 156
	13  UIKit                               0x34af0a81 <redacted> + 224
	14  vTurning                            0x0002b82b -[EGORefreshTableHeaderView egoRefreshScrollViewDataSourceDidFinishedLoading:] + 186
	15  vTurning                            0x0003e23d -[PopularWRController finishLoadingTableViewData] + 772
	16  Foundation                          0x32aaba6f <redacted> + 450
	17  CoreFoundation                      0x386505df <redacted> + 14
	18  CoreFoundation                      0x38650291 <redacted> + 272
	19  CoreFoundation                      0x3864ef01 <redacted> + 1232
	20  CoreFoundation                      0x385c1ebd CFRunLoopRunSpecific + 356
	21  CoreFoundation                      0x385c1d49 CFRunLoopRunInMode + 104
	22  GraphicsServices                    0x38c5e2eb GSEventRunModal + 74
	23  UIKit                               0x34ad4301 UIApplicationMain + 1120
	24  vTurning                            0x0001e5a1 main + 100
	25  vTurning                            0x0001e538 start + 40
)

发现是数组越界引起的问题,仔细查看是
EGORefreshTableHeaderView,在重新加载数据的时候,把之前的数据清理掉了,重新reload的时候出错。
问题已经定位了,后面就很好解决了。

最近发现了一些之前没有出现的问题bug,总以为是SDK的问题,总的来说自己要进行定位,不依赖于工具。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值