在iOS8中dismissViewControllerAnimated崩溃

问题描述 投票:4回答:2

我有一个在iOS7.0 / 7.1中运行良好的应用程序自上次iOS更新(8.0)以来,dismissViewControllerAnimated每次都崩溃。有人看到了同样的事情吗? 我有一个控件来调用第二个控制器:

**detailViewController.delegate = self;
[self presentViewController:detailViewController animated:YES completion:nil];**

在关闭按钮我用这个:

**// Do something with the sender if needed
[viewController dismissViewControllerAnimated:YES completion:NULL];**

我用这个(Remove view controller from another view controller)作为实施“第二”控制的指南,但崩溃再次出现。

有任何想法吗 ?

ios objective-c iphone ios8
2个回答
5
投票

当我以编程方式解雇时,我遇到了一个非常类似的问题。 (就像代表完成一个过程)。

我用过这个并且完美地工作了:

if (![self isBeingDismissed]) {
    [self dismissViewControllerAnimated:YES completion:^{
    }];
}

它只是检查它是否已经被解雇。希望这对你有用!


0
投票

检查是否有如下所述定义的dealloc功能。因为它可能会导致崩溃。

- (void)dealloc {
      [_yourview release]; //don't do this
      [super dealloc];
}
© www.soinside.com 2019 - 2024. All rights reserved.