While animation of one segue(like perforrmsegue) is going, if other segue occures (if user press other button at that time) then application is crashing.
The same problem for the pop and pushViewController on UINavigationController is solved here.
Can we use same trik for segue also or there is other solution.
I get the following stack after crash. (Exeption at [NSException initWithCoder:]).
0 CoreFoundation 0x2f9fbf4b __exceptionPreprocess
1 libobjc.A.dylib 0x39d8b6af objc_exception_throw
2 CoreFoundation 0x2f9fbe8d -[NSException initWithCoder:]
3 UIKit 0x3217a48f -[UIView(Internal) _addSubview:positioned:relativeTo:]
4 UIKit 0x3217a417 -[UIView(Hierarchy) addSubview:]
5 UIKit 0x32342b71 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke
6 UIKit 0x321806e5 +[UIView(Animation) performWithoutAnimation:]
If this exeption is for any other reason then please mention that because I an not sure about the segue.
I think this is a more simpler solution:
This solution worked for me and I think it's general practice to add this in the program.
1)
First add
BOOL
property to your .h file of your app's appDelegateAlso implement the
UINavigationControllerDelegate
:Set Your_AppDelegate as UINavigationController's delegate in
application:didFinishLaunchingWithOptions:
of your appDelegate:2)
Now Add this UINavigationControllerDelegate method in .m file of your appDelegate:
3)
Finally Add the following code whenever you are segueing
Hope this will help to one having segue crash problem.