iOS 6上的PresentViewController崩溃

iOS 6上的PresentViewController崩溃,ios,crash,sigabrt,Ios,Crash,Sigabrt,我的应用程序出现了奇怪的崩溃问题。一旦我从ViewController输入B ViewController,它就会崩溃(不是每次,只发生一次)。这是密码 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSUInteger row = [indexPath row]; NSUInteger section = [indexPath

我的应用程序出现了奇怪的崩溃问题。一旦我从ViewController输入B ViewController,它就会崩溃(不是每次,只发生一次)。这是密码

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{   
    NSUInteger row = [indexPath row];  
    NSUInteger section = [indexPath section];

    if( section == 0 && row == 0 && self.uidString && self.profileDic)
    {
            BViewController *bviewcontroller = [[BViewController alloc] init];
            [bviewcontroller setProfileDic:self.profileDic];
            bviewcontroller.delegate = self;
            bviewcontroller.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
            [self presentModalViewController:bviewcontroller animated:YES];
            [bviewcontroller release];
    }
}
事故记录是

Date/Time:       2013-06-18 10:00:39.720 +0800
OS Version:      iOS 6.1.4 (10B350)
Report Version:  104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread:  0

Last Exception Backtrace:
0   CoreFoundation                  0x31d3c3e2 __exceptionPreprocess + 158
1   libobjc.A.dylib                 0x39a3795e objc_exception_throw + 26
2   CoreFoundation                  0x31d3c298 +[NSException raise:format:arguments:] + 96
3   Foundation                      0x32612f9e -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 86
4   UIKit                           0x33c37754 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 172
5   UIKit                           0x33c36fa6 -[UIViewController presentViewController:withTransition:completion:] + 3394
6   UIKit                           0x33d58d9e -[UIViewController presentModalViewController:animated:] + 26

我寻找答案,这里的一些帖子说这是因为UIViewController的“presentViewController”方法在iOS 4.3上不可用,解决方案只是将“presentViewController”更改为“presentModalViewController”。但这正是我的代码所做的。有人知道会发生什么吗?提前感谢。

您可能需要将显示的视图控制器保留在某个位置(例如在iVar中)。我猜它在出现之前就被释放了。

你能发布代码实现吗?嗨,MrBr,我刚刚发布了代码。嗨,frasmage,我没有使用ARC,但从上面的源代码来看,我认为它在出现之前没有被释放。(正如我所提到的,这次事故只发生过一次)