2
IOS 8对方向变化的碰撞....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];
}
取消我们旋转....碰撞发生后控制器....
ERR或显示.....如下所示
*** -[UINavigationController _viewControllerForSupportedInterfaceOrientationsWithDismissCheck:]: message sent to deallocated instance 0x16ad08c0
我们调用它在表视图做选择索引方法....从那里我们调用委托方法,以便委托(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell * cell = [self.tableView cellForRowAtIndexPath:indexPath]; NSString * file = [self.delegate didSelectedWithReportType:cell.textLabel.text]; [self.delegate didShowReport:file withTitle:NSLocalizedString(@“MaintenanceReport”,@“”)]; } – 2014-10-08 07:33:07
这是在IOS 7上完美工作,但在IOS 8中只有这个问题......在一个表视图didselect方法中,我们调用了一个委托[self.delegate didShowReport:file withTitle:NSLocalizedString(@“MaintenanceReport “,@”“)];里面这个didshowreport方法这个视图控制器正在呈现.... – 2014-10-08 07:38:05
谢谢!这解决了我的问题。我正在使用'actionSheet:clickedButtonAtIndex:'将一个'UINavigationController'呈现为模式,这导致方向更改事件使我的应用崩溃。按照这个答案中的建议,我将它改为'didDismissWithButtonIndex:'。 – 2014-11-03 08:08:40