- 復現(xiàn)步驟
在拍照頁面中雙指捏合后會出現(xiàn)CMKZoomSlider
姜挺,這個view出現(xiàn)后會在5s后自動消失蚤假。如果在它消失前的一剎那點擊“取消”將拍照頁面dismiss掉的話就會出現(xiàn)crash。
系統(tǒng): iOS 9全系統(tǒng)
崩潰信息
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_INVALID_TASK at 0x0000000000000010
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib objc_msgSend + 16
1 Foundation __NSFireDelayedPerform + 428
2 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
3 CoreFoundation __CFRunLoopDoTimer + 884
4 CoreFoundation __CFRunLoopRun + 1520
5 CoreFoundation CFRunLoopRunSpecific + 384
6 GraphicsServices GSEventRunModal + 180
7 UIKit UIApplicationMain + 204
8 moma main (main.m:14)
9 libdyld.dylib 0x00000001823028b8 0x182300000 + 10424
然而佩番,卵用沒有~
從crash出現(xiàn)時的頁面記錄中發(fā)現(xiàn)了線索:
2018-04-20 18:26:47 [APPEAR]DEFMultipleImagePickerTableViewController
2018-04-20 18:26:47 [APPEAR]DEFAlbumPickerViewController
2018-04-20 18:26:47 [DISAPPEAR]PLUICameraViewController
2018-04-20 18:26:47 [ACTION]PLCropOverlay(_tappedBottomBarCancelButton:)
2018-04-20 18:26:39 [APPEAR]PLUICameraViewController
2018-04-20 18:26:39 [DISAPPEAR]DEFAlbumPickerViewController
2018-04-20 18:26:39 [LOADED]PLUICameraViewController
2018-04-20 18:26:38 [DISAPPEAR]DEFMultipleImagePickerTableViewController
2018-04-20 18:26:38 [ACTION]DEFMultipleImageTableViewCell(cameraButtonClicked:)
2018-04-20 18:26:33 [APPEAR]DEFMultipleImagePickerTableViewController
最后是在系統(tǒng)的拍照頁面PLUICameraViewController
消失之后崩潰的,借著這個線索在SO上找到了復現(xiàn)步驟:
https://stackoverflow.com/questions/26844432/how-to-find-out-what-causes-a-didhidezoomslider-error-on-ios-8/29959695
- 解決方案:
Hook PLUICameraViewController
類的viewWillDisappear
方法,將CMKZoomSlider
的delegate
設為nil瓦糟。詳見SO。