IOS 8在方向改变时崩溃了

时间:2014-10-08 06:12:27

标签: crash ios8 orientation

IOS 8因方向改变而崩溃....

首先我们在这里显示一份报告..

  -(void)didShowReport:(NSString *)fileName andFlag:(BOOL) isWeightReport
{
    UIStoryboard *storyBoard = [UIStoryboard  storyboardWithName:@"Document_Picker" bundle:nil];
    UINavigationController *nav = [storyBoard instantiateViewControllerWithIdentifier:@"reportNav"];
    NSLog(@"topviewcontrolle - %@",[nav topViewController]);
    SSReportPreviewViewController *reportPreview = (SSReportPreviewViewController *) [nav topViewController];
    reportPreview.fileName = fileName;
    //reportPreview.delegate = self;
    reportPreview.title = [fileName lastPathComponent];
    if(isWeightReport)
        reportPreview.mailSubject = NSLocalizedString(@"weightsummaryreport", @"");
    else
        reportPreview.mailSubject = NSLocalizedString(@"pricesummaryreport", @"");


     [nav setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
    [self presentViewController:nav animated:YES completion:nil];
}

之后我们将使用

取消该视图控制器
 - (IBAction)onCancel:(id)sender {    
    [self dismissViewControllerAnimated:YES completion:nil];
}

取消后我们轮流....崩溃发生....

错误显示.....如下所示

*** -[UINavigationController _viewControllerForSupportedInterfaceOrientationsWithDismissCheck:]: message sent to deallocated instance 0x16ad08c0

1 个答案:

答案 0 :(得分:1)

在用户按下操作表中的按钮后,您是否正在展示? (或者可能是警报视图?)

iOS 8现在会在自己的窗口中显示操作表。 (检查哪个窗口是来自app delegate的键。)如果在该窗口被解除之前呈现模态,则模式将从操作表的窗口显示(或者至少从其中引用并在旋转期间调出。)

尝试使用didDismissWithButtonIndex:而不是willDismissWithButtonIndex :. 如果这不起作用,请尝试以0.1或0.2秒的延迟发送您的演示文稿。 (有时只是调度到主队列以提供单个运行循环延迟就足够了。)