對不起,我已經縮小了錯誤,因此它不是AFNetworking問題,而是UI問題。嘗試關閉iOS中的彈出窗口時出現異常
我有一個集合視圖。當我點擊集合視圖時,會顯示一個彈出窗口,我可以選擇下載某個內容,然後進度條顯示進度。同時,collectionviewcell還會在其自身上顯示另一個進度條。然後我關上窗戶,再次敲擊牢房,做點什麼然後關上它。它可能不會在第二次引發異常,並且當我再次打開並關閉popOver時,引發異常。
這裏是LLDB的BT跟蹤:
* thread #1: tid = 0x1214fc, 0x38592626 libobjc.A.dylib`objc_msgSend + 6, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xb1b8d8b0)
frame #0: 0x38592626 libobjc.A.dylib`objc_msgSend + 6
frame #1: 0x302f7056 UIKit`-[UIApplication sendAction:to:from:forEvent:] + 90
frame #2: 0x302f6ff6 UIKit`-[UIApplication sendAction:toTarget:fromSender:forEvent:] + 30
frame #3: 0x302f6fd0 UIKit`-[UIControl sendAction:to:forEvent:] + 44
frame #4: 0x302e2736 UIKit`-[UIControl _sendActionsForEvents:withEvent:] + 374
frame #5: 0x302f6a4e UIKit`-[UIControl touchesEnded:withEvent:] + 590
frame #6: 0x302f6720 UIKit`-[UIWindow _sendTouchesForEvent:] + 528
frame #7: 0x302f16ea UIKit`-[UIWindow sendEvent:] + 758
frame #8: 0x302c68ec UIKit`-[UIApplication sendEvent:] + 196
frame #9: 0x302c4f96 UIKit`_UIApplicationHandleEventQueue + 7102
frame #10: 0x2da7125a CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
frame #11: 0x2da7072a CoreFoundation`__CFRunLoopDoSources0 + 206
frame #12: 0x2da6ef1e CoreFoundation`__CFRunLoopRun + 622
frame #13: 0x2d9d9f4e CoreFoundation`CFRunLoopRunSpecific + 522
frame #14: 0x2d9d9d32 CoreFoundation`CFRunLoopRunInMode + 106
frame #15: 0x328d3662 GraphicsServices`GSEventRunModal + 138
frame #16: 0x3032516c UIKit`UIApplicationMain + 1136
* frame #17: 0x0003b12c ChinesePod`main(argc=1, argv=0x27dccd04) + 300 at main.m:39
我不知道什麼是錯的通過查看跟蹤。任何想法我的應用程序有什麼問題?
編輯:
當我啓用NSZombie,我看到這個錯誤在控制檯:
*** -[BlurViewController performSelector:withObject:withObject:]: message sent to deallocated instance 0x166e7df0
的BlurViewController是一個視圖控制器負責顯示酥料餅的窗口。這是否意味着BlurViewController被釋放? dismissDialog的
的源代碼:
- (void)dismissDialog
{
[UIView animateWithDuration:kAnimationDuration animations:^{
self.view.alpha = 0.f;
self.popUp.transform = CGAffineTransformMakeScale(0, 0);
} completion:^(BOOL finished) {
[self removeFromParentViewController];
[self.view removeFromSuperview];
[self.popUp removeFromSuperview];
if (!self.popUp.isDownloading) {
_popUp = nil;
}
[UIView animateWithDuration:kAnimationDuration animations:^{
_blurView.alpha = 0.f;
} completion:^(BOOL finished) {
[_blurView removeFromSuperview];
}];
}];
}
請給你使用AFNetworking下載的代碼。 – DilumN
您所指的某個對象已被釋放。請張貼您的popover顯示方法的代碼。你也可以嘗試運行NSZombies啓用 – Paulw11
@ Paulw11在Xode中啓用殭屍將會有所幫助,但是使用Instruments with Zombies setup會更好...可以查看所有refcount增量和減量以及哪些代碼是負責任的,每個iOS都必須知道開發商 – RobP