Sigabrt错误的自定义推segue
问题描述:
我收到错误:Thread 1, Signal SIGABRT
当我运行我的应用程序,并按下按钮时,我添加了自定义推继续。Sigabrt错误的自定义推segue
错误日志:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'
这里的自定义SEGUE代码
#import <UIKit/UIKit.h>
@interface PushNoAnimationSegue : UIStoryboardSegue
@end
@implementation PushNoAnimationSegue
-(void) perform{
[[[self sourceViewController] navigationController] pushViewController:[self destinationViewController] animated:NO];
}
@end
所有网点都占了,有不似乎是任何松散的。
这是什么问题,我该如何解决这个问题?
答
该错误表明您尝试将UINavigationController
实例推送到UINavigationController
。这是不允许的(因为错误状态)。看起来你的故事板很可能没有正确设置。您可以通过检查[self destinationViewController]
的类型进行验证,但不应该是UINavigationController
。
对于那些正在努力找出iOS 10中的错误的人,在使用库/照片/媒体时,您的应用可能会与SIGABORT崩溃。您需要在Info.plist中添加一些密钥,请检查[此链接。](http://*.com/a/39631642/1223728) – Borzh