当我执行 [self.navigationController popViewControllerAnimated:YES] 时,我的应用程序崩溃了。
它在设备上比在模拟器上崩溃更多。请建议如何解决这个问题?
Date/Time: 2010-11-09 10:51:41.325 +0800 OS Version: iPhone OS 4.0.1 (8A306) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x00000000 Crashed Thread: 0 Thread 0 Crashed: 0 libobjc.A.dylib 0x0000286e objc_msgSend + 18 1 CoreFoundation 0x00002c30 -[NSObject(NSObject) release] + 24 2 libobjc.A.dylib 0x00003c1a objc_setProperty + 114 3 UIKit 0x000693d4 -[UINavigationController setDisappearingViewController:] + 24 4 UIKit 0x0007d5c0 -[UINavigationController _clearLastOperation] + 40 5 UIKit 0x0007d4b4 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 556 6 UIKit 0x0007d248 -[UINavigationTransitionView _notifyDelegateTransitionDidStopWithContext:] + 204 7 UIKit 0x0007d0b6 -[UINavigationTransitionView _navigationTransitionDidStop] + 450 8 UIKit 0x00059974 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 184 9 UIKit 0x0005987e -[UIViewAnimationState animationDidStop:finished:] + 34 10 QuartzCore 0x000127ba run_animation_callbacks(double, void*) + 286 11 QuartzCore 0x0001265c CA::timer_callback(__CFRunLoopTimer*, void*) + 116 12 CoreFoundation 0x00071a54 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 8 13 CoreFoundation 0x00073ede __CFRunLoopDoTimer + 854 14 CoreFoundation 0x0007485e __CFRunLoopRun + 1082 15 CoreFoundation 0x0001d8e4 CFRunLoopRunSpecific + 224 16 CoreFoundation 0x0001d7ec CFRunLoopRunInMode + 52 17 GraphicsServices 0x000036e8 GSEventRunModal + 108 18 GraphicsServices 0x00003794 GSEventRun + 56 19 UIKit 0x000062a0 -[UIApplication _run] + 396 20 UIKit 0x00004e10 UIApplicationMain + 664 21 tenpay 0x00006124 main (main.m:13) 22 tenpay 0x00002324 start + 44
最佳答案
myviewcontroller = [[[MyViewController alloc]init]autorelease];
[self.navigationController pushViewController:myviewcontroller animated:YES];
[myviewcontroller release]; //This is my bug !!! I just fixed it.
关于iphone - popViewController动画:YES crashes my app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4130179/