iOS libc++abi.dylib: handler threw exception 錯誤的解決方案

本文轉載自:https://www.cnblogs.com/easonoutlook/archive/2012/09/28/2707234.html 作者:easonoutlook 轉載請註明該聲明。

簡單說下背景:最近把工具和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 篇原創文章 · 獲贊 130 · 訪問量 77萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章