Ios 使用无动画segue崩溃应用程序

Ios 使用无动画segue崩溃应用程序,ios,Ios,我正在使用UIStoryboardSegue子类来抑制推送动画序列 #import "NoAnimationSegue.h" @implementation NoAnimationSegue - (void)perform { UIViewController *src = (UIViewController *) self.sourceViewController; UIViewController *dst = (UIViewController *) self.dest

我正在使用
UIStoryboardSegue
子类来抑制推送动画序列

#import "NoAnimationSegue.h"

@implementation NoAnimationSegue

- (void)perform
{
    UIViewController *src = (UIViewController *) self.sourceViewController;
    UIViewController *dst = (UIViewController *) self.destinationViewController;
    NSLog(@"src %@", src);
    [src.navigationController pushViewController:dst animated:NO];
}

@end
在某些情况下,使用此segue有时会使我的应用程序崩溃。当我禁用此代码并使用push segue时,它工作正常


有什么想法吗?

上面的代码对我来说很好用。在这个子类segue中如何调用“perform”方法?我用下面的例子检查了你的子类,它工作得很好,你能用代码来调用“perform”方法吗


出现此问题是因为我在故事板中将手势识别器添加到了我的
destinationViewController


当我移除手势识别器或通过代码添加识别器时……效果很好

应用程序崩溃消息是什么?另外,您是否检查了应用程序是否占用了太多内存?您是否将UIViewController?src.navigationController分配给self.navigationController
SecondViewController *second = [[SecondViewController alloc] init];
NoAnimationSegue *animate = [[NoAnimationSegue alloc] initWithIdentifier:@"1" source:self destination:second];
[animate perform];