Application crashed when push viewcontroller with animate YES - ios

I came across a weird problem when using autolayout. In my xibs, I add some Aspect Ratio constraints. When I push a view controller with animate YES, it crashes with "NSInternalInconsistencyException" and "Cannot find an outgoing row head for incoming head UIView:" something like that. When the animated is set to NO,it seems ok. And this happens in lower ios8.
Then I found something in AutoLayout views make app crash on popViewController. I followed narsil's answer,and somehow fix it. But I couldn't figure it out the reason. It seems I had to remove every Aspect ratio constraint in the viewWillDisappear method whenever it leaves the controller.
Is there any other way to solve this?
Here is the log,I just cut out part of it.
[4150:60b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<NSISEngine: 0x7f8749c3f650>{ Rows:
0x7f8749c5f500.posErrorMarker{id: 259} == 135 + 1*0x7f8749f80610.marker{id: 80} + 3*0x7f8749f80f00.marker{id: 178} + 1*0x7f8749f80f50.marker{id: 179} + -1*0x7f8749f81310.marker{id: 198} + 1*0x7f8749f81360.marker{id: 199} + 2*0x7f8749f81400.marker{id: 203} + 1*0x7f8749f81770.marker{id: 221} + 1*0x7f8749f81810.marker{id: 224} + -1*0x7f8749f82b30.marker{id: 235} + -1*0x7f8749f82bd0.marker{id: 239} + 1*0x7f8749f82cc0.marker{id: 245} + 1*0x7f8749f82d10.marker{id: 247} + 1*0x7f8749c5f500.negError{id: 260} + 3*0x7f8749f6dc30.posErrorMarker{id: 343} + -3*0x7f8749f6dc30.negError{id: 344}
0x7f8749c63650.negError{id: 288} == 0 + -1*0x7f8749f80f00.marker{id: 178} + -1*0x7f8749f81400.marker{id: 203} + 1*0x7f8749c63650.posErrorMarker{id: 287} + -1*0x7f8749f6dc30.posErrorMarker{id: 343} + 1*0x7f8749f6dc30.negError{id: 344}
0x7f8749c63e50.posErrorMarker{id: 289} == 284 + -9.48148*0x7f8749f80570.marker{id: 79} + -0.333333*0x7f8749f80fa0.marker{id: 181} + -0.333333*0x7f8749f81090.marker{id: 186} + -0.666667*0x7f8749f810e0.marker{id: 188} + 0.333333*0x7f8749f81130.marker{id: 189} + -0.333333*0x7f8749f811d0.marker{id: 191} + -0.333333*0x7f8749f81220.marker{id: 194} + 1*0x7f8749f812c0.marker{id: 197} + 0.666667*0x7f8749f82c70.marker{id: 244} + 4.74074*0x7f8749c5f580.posErrorMarker{id: 261} + -4.74074*0x7f8749c5f580.negError{id: 262} + 1*0x7f8749c63e50.negError{id: 290}
Statistics:
171 rows. Variable counts:
1 -> 40
2 -> 50
3 -> 7
4 -> 11
5 -> 6
6 -> 5
7 -> 5
8 -> 2
9 -> 4
10 -> 6
11 -> 6
12 -> 4
13 -> 6
14 -> 5
15 -> 3
16 -> 4
17 -> 4
19 -> 3
}: internal error. Cannot find an outgoing row head for incoming head UILabel:0x7f874c05b950.Width{id: 5939}, which should never happen.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000106cda495 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010674a99e objc_exception_throw + 43
2 CoreFoundation 0x0000000106cda2ad +[NSException raise:format:] + 205
3 Foundation 0x0000000106338054 -[NSISEngine minimizeConstantInObjectiveRowWithHead:] + 178
4 Foundation 0x0000000106337f22 -[NSISEngine optimize] + 147
5 Foundation 0x00000001064802e3 -[NSISEngine withBehaviors:performModifications:] + 192
6 UIKit 0x0000000107364889 -[UIView(Hierarchy) _postMovedFromSuperview:] + 321
7 UIKit 0x0000000107362f42 __UIViewWasRemovedFromSuperview + 206
8 UIKit 0x0000000107362b9e -[UIView(Hierarchy) removeFromSuperview] + 218
9 UIKit 0x0000000107425069 -[UINavigationController navigationTransitionView:didEndTransition:fromView:toView:] + 320
10 UIKit 0x000000010741dfdd __49-[UINavigationController _startCustomTransition:]_block_invoke + 138
11 UIKit 0x0000000107973c2a -[_UIViewControllerTransitionContext completeTransition:] + 78
12 UIKit 0x0000000107306da4 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke103 + 605
13 UIKit 0x00000001073696e8 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 299
14 UIKit 0x000000010735568e -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 235
15 UIKit 0x0000000107355941 -[UIViewAnimationState animationDidStop:finished:] + 78
16 QuartzCore 0x000000010a920134 _ZN2CA5Layer23run_animation_callbacksEPv + 310
17 libdispatch.dylib 0x000000010868172d _dispatch_client_callout + 8
18 libdispatch.dylib 0x00000001086713fc _dispatch_main_queue_callback_4CF + 354
19 CoreFoundation 0x0000000106d38289 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
20 CoreFoundation 0x0000000106c85854 __CFRunLoopRun + 1764
21 CoreFoundation 0x0000000106c84d83 CFRunLoopRunSpecific + 467
22 GraphicsServices 0x000000010900df04 GSEventRunModal + 161
23 UIKit 0x0000000107310e33 UIApplicationMain + 1010
24 Mytest 0x00000001060b10a3 main + 115
25 libdyld.dylib 0x00000001089065fd start + 1
26 ??? 0x0000000000000001 0x0 + 1
)

Related

It crashes when clicking the link of webview in iOS 13

When the link in webview with clicking, there is no response. When the link with long press, it crash with the message:
Trapped uncaught exception 'NSInternalInconsistencyException', reason: '_UIClickPresentationInteraction cannot determine presenting view controller.'
0 CoreFoundation 0x00007fff23b98bde __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff503b5b20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23b98958 +[NSException raise:format:arguments:] + 88
3 Foundation 0x00007fff255eb6f5 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 191
4 UIKitCore 0x00007fff470cf0fd -[_UIClickPresentationInteraction _canPerformPresentation] + 431
5 UIKitCore 0x00007fff470d16eb -[_UIClickPresentationInteraction _handleTransitionToPreview] + 136
6 UIKitCore 0x00007fff470d1046 __55-[_UIClickPresentationInteraction _prepareStateMachine]_block_invoke_3 + 35
7 UIKitCore 0x00007fff471f0fb0 -[_UIStateMachine handleEvent:withContext:] + 412
8 UIKitCore 0x00007fff470cff63 -[_UIClickPresentationInteraction clickInteractionDidClickUp:] + 55
9 UIKitCore 0x00007fff46dd5aed -[_UIClickInteraction clickDriver:didPerformEvent:] + 316
10 UIKitCore 0x00007fff46a3831f __58-[_UILongPressClickInteractionDriver _prepareStateMachine]_block_invoke_2 + 74
11 UIKitCore 0x00007fff471f0fb0 -[_UIStateMachine handleEvent:withContext:] + 412
12 UIKitCore 0x00007fff46a38e04 -[_UILongPressClickInteractionDriver _updateForActiveGestureRecognizer] + 673
13 UIKitCore 0x00007fff46a38a59 -[_UILongPressClickInteractionDriver _handleGestureRecognizer:] + 382
14 UIKitCore 0x00007fff46d1e777 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 44
15 UIKitCore 0x00007fff46d27909 _UIGestureRecognizerSendTargetActions + 109
16 UIKitCore 0x00007fff46d24fc5 _UIGestureRecognizerSendActions + 298
17 UIKitCore 0x00007fff46d242f2 -[UIGestureRecognizer _updateGestureForActiveEvents] + 757
18 UIKitCore 0x00007fff46d16308 _UIGestureEnvironmentUpdate + 2700
19 CoreFoundation 0x00007fff23afaeb7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
20 CoreFoundation 0x00007fff23af594e __CFRunLoopDoObservers + 430
21 CoreFoundation 0x00007fff23af5fca __CFRunLoopRun + 1514
22 CoreFoundation 0x00007fff23af56b6 CFRunLoopRunSpecific + 438
23 GraphicsServices 0x00007fff3815cbb0 GSEventRunModal + 65
24 UIKitCore 0x00007fff47162a67 UIApplicationMain + 1621
25 IBUWireless 0x000000010b372728 main + 296
26 libdyld.dylib 0x00007fff5123bcf5 start + 1
27 ??? 0x0000000000000001 0x0 + 1
iOS13 OS
I have recently fixed this issue and solved by setting
webviewcontroller.modalPresentationStyle = .fullScreen
self.present(webviewcontroller, animated: animated, completion: nil)
Webview has been depricated so You must use WKWebView.
Note
In apps that run in iOS 8 and later, use the WKWebView class instead of using UIWebView. Additionally, consider setting the WKPreferences property javaScriptEnabled to false if you render files that are not supposed to run JavaScript.
Read WkWebView
https://developer.apple.com/documentation/webkit/wkwebview

my app crash in uikit ,only happen on IPhone X and above exception name NSInternalInconsistencyException

Failed to load bounding path bitmap data from the asset manager for asset name: BoundingPathBitmap-1125x2436-375x812-3.00x
The crash happen on the viewcontroller contain UIScrollView When open it,and only happens with the iPhone X and above
We develop app UI use storyboard
0 CoreFoundation ___exceptionPreprocess + 228
1 libobjc.A.dylib objc_exception_throw + 56
2 CoreFoundation +[_CFXNotificationTokenRegistration keyCallbacks]
3 Foundation -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
4 UIKitCore -[_UIScreenBezierBoundingPathUtilities _loadBitmapForScreen:type:] + 1124
5 UIKitCore -[_UIScreenBezierBoundingPathUtilities initWithScreen:] + 144
6 UIKitCore +[_UIScreenBoundingPathUtilities boundingPathUtilitiesForScreen:] + 108
7 UIKitCore -[UIScreen _boundingPathUtilities] + 56
8 UIKitCore -[UIWindow _boundingPath] + 168
9 UIKitCore -[UIView(UIViewBoundingPathSupportInternal) _effectiveBoundingPathAndBoundingPathView:] + 256
10 UIKitCore -[UIView(UIViewBoundingPathSupport) _inscribedRectInBoundingPathByInsettingRect:onEdges:withOptions:] + 88
11 UIKitCore -[UIScrollView(UIScrollViewInternal) _baseInsetsForTrailingEdgeAccessoryWithBoundingPathEdgesToUse:safeAreaInsets:bounds:scale:accessoryWidth:additionalInsetFromEdge:] + 180
12 UIKitCore -[UIScrollView(UIScrollViewInternal) _baseInsetsForAccessoryOnEdge:hasCustomClientInsets:accessorySize:additionalInsetFromEdge:] + 1388
13 UIKitCore -[UIScrollView(UIScrollViewInternal) _effectiveVerticalScrollIndicatorInsets] + 152
14 UIKitCore -[UIScrollView _layoutVerticalScrollIndicatorWithBounds:effectiveInset:contentOffset:fraction:additionalInset:cornerAdjust:showing:recalcSize:] + 252
15 UIKitCore -[UIScrollView _adjustScrollerIndicators:alwaysShowingThem:] + 1040
16 UIKitCore -[UIScrollView _updateForChangedScrollIndicatorRelatedInsets] + 132
17 UIKitCore __UIScrollViewAdjustForOverlayInsetsChangeIfNecessary + 512
18 UIKitCore -[UIScrollView(UIScrollViewInternal) setSafeAreaInsets:] + 312
19 UIKitCore -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] + 1288
20 UIKitCore -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 124
21 UIKitCore -[UIScrollView(_UIOldConstraintBasedLayoutSupport) _resizeWithOldSuperviewSize:] + 52
22 CoreFoundation -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 464
23 UIKitCore -[UIView(Geometry) resizeSubviewsWithOldSize:] + 156
24 UIKitCore -[UIView(AdditionalLayoutSupport) _is_layout] + 152
25 UIKitCore -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 988
26 UIKitCore -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1380
27 QuartzCore 0x00000001ca79e000 + 1309564
28 QuartzCore 0x00000001ca79e000 + 1329972
29 QuartzCore 0x00000001ca79e000 + 669080
30 QuartzCore 0x00000001ca79e000 + 859848
31 QuartzCore 0x00000001ca79e000 + 863536
32 CoreFoundation ___CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
33 CoreFoundation ___CFRunLoopDoObservers + 412
34 CoreFoundation ___CFRunLoopRun + 1264
35 CoreFoundation CFRunLoopRunSpecific + 436
36 GraphicsServices GSEventRunModal + 100
37 UIKitCore UIApplicationMain + 212
38 live main (main.mm:23)
39 libdyld.dylib 0x00000001c5d2a000 + 2996
hope someone could give me some advice, thanks
The same crash also happened in my app.
When I turned off the 'Show Horizontal Indicator' and 'Show Vertical Indicator' on the storyboard, the crash no longer occurred.
It just happened with my app .. Fixed ,
Delete the app and restart Simulator ..
^ command + shift + K to clean build folder

How to return the same viewController multiple times in swift(iOS) in a single run of the program?

I am writing a program using SpriteKit and UIKit.
I have two view controller in my program, first for main page and second for GameViewController (which includes GameScene). I have added a back button to the GameViewController which goes to main page (MainPageViewController). Everything works fine so far.
In my first page, when I wanted to go back again to GameViewController, program crashes and the following error is given:
GitarTelleri[959:47801] 15:21:39.405 ERROR:
AVAudioEngineGraph.mm:1743: _Connect: required condition is false:
!destNodeMixerConns.empty() && !isDestNodeConnectedToIONode 2016-09-19
15:21:39.413 GitarTelleri[959:47801] * Terminating app due to
uncaught exception 'com.apple.coreaudio.avfaudio', reason: 'required
condition is false: !destNodeMixerConns.empty() &&
!isDestNodeConnectedToIONode'
* First throw call stack: ( 0 CoreFoundation 0x0000000104250d85 exceptionPreprocess + 165 1 libobjc.A.dylib
0x00000001061d2deb objc_exception_throw + 48 2 CoreFoundation
0x0000000104250bea +[NSException raise:format:arguments:] + 106 3
libAVFAudio.dylib 0x000000010915eff3
_Z19AVAE_RaiseExceptionP8NSStringz + 176 4 libAVFAudio.dylib 0x0000000109171bc3
_ZN18AVAudioEngineGraph8_ConnectEP19AVAudioNodeImplBaseS1_jjP13AVAudioFormat
+ 1281 5 libAVFAudio.dylib 0x0000000109174df0 _ZN18AVAudioEngineGraph7ConnectEP11AVAudioNodeS1_mmP13AVAudioFormat + 322 6 libAVFAudio.dylib 0x00000001091a7a71
_ZN17AVAudioEngineImpl7ConnectEP11AVAudioNodeS1_mmP13AVAudioFormat + 301 7 libAVFAudio.dylib 0x00000001091a7ad8
-[AVAudioEngine connect:to:format:] + 83 8 AudioKit 0x00000001037a611b
_TTSf4n_d___TZFC8AudioKit8AudioKits6outputGSqCS_6AKNode_ + 267 9 GitarTelleri 0x000000010362c234
TFC12GitarTelleri18GameViewController13viewDidAppearfSbT + 196 10 GitarTelleri 0x000000010362c341
TToFC12GitarTelleri18GameViewController13viewDidAppearfSbT + 49 11 UIKit 0x0000000104df7335
-[UIViewController _setViewAppearState:isAnimating:] + 830 12 UIKit 0x0000000104e30589 -[UINavigationController viewDidAppear:] + 207 13
UIKit 0x0000000104df7335
-[UIViewController _setViewAppearState:isAnimating:] + 830 14 UIKit 0x0000000104df7cb8 -[UIViewController _endAppearanceTransition:] + 262
15 UIKit 0x0000000104dc208a
-[UIPresentationController transitionDidFinish:] + 827 16 UIKit 0x0000000104f9f38f -[_UICurrentContextPresentationController
transitionDidFinish:] + 42 17 UIKit
0x0000000104dc57c1 __56-[UIPresentationController
runTransitionForCurrentState]_block_invoke_2 + 183 18 UIKit
0x00000001056844c8 -[_UIViewControllerTransitionContext
completeTransition:] + 101 19 UIKit
0x0000000104dbef77 -[UITransitionView notifyDidCompleteTransition:] +
252 20 UIKit 0x0000000104dbec88
-[UITransitionView _didCompleteTransition:] + 1344 21 UIKit 0x0000000104dc13f4 -[UITransitionView _transitionDidStop:finished:] +
104 22 UIKit 0x0000000104ce47ff
-[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 241 23 UIKit 0x0000000104ce4bae
-[UIViewAnimationState animationDidStop:finished:] + 80 24 QuartzCore 0x0000000107d7d3c8
_ZN2CA5Layer23run_animation_callbacksEPv + 308 25 libdispatch.dylib 0x0000000108c773eb _dispatch_client_callout + 8 26 libdispatch.dylib
0x0000000108c5f1ef _dispatch_main_queue_callback_4CF + 1738 27
CoreFoundation 0x00000001041aa0f9
__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 28 CoreFoundation 0x000000010416bb99 __CFRunLoopRun
+ 2073 29 CoreFoundation 0x000000010416b0f8 CFRunLoopRunSpecific + 488 30 GraphicsServices
0x000000010a189ad2 GSEventRunModal + 161 31 UIKit
0x0000000104c56f09 UIApplicationMain + 171 32 GitarTelleri
0x0000000103630372 main + 114 33 libdyld.dylib
0x0000000108cab92d start + 1 34 ???
0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with
uncaught exception of type NSException (lldb)
Should I change something in AppDelegate.swift or should I clean something when BackButton is clicked?
check your back button have AudioKit.stop()

Swift - UIWebView - This application is modifying the autolayout engine

I am trying to embed a youtube video in a UIWebView the code I have works fine however, every time I play the video and the video players opens I get a warning:
This application is modifying the autolayout engine from a background
thread, which can lead to engine corruption and weird crashes. This
will cause an exception in a future release.
Stack:( 0
CoreFoundation 0x0000000181e96dc8 +
148 1 libobjc.A.dylib 0x00000001814fbf80
objc_exception_throw + 56 2 CoreFoundation
0x0000000181e96cf8 + 0 3 Foundation
0x0000000182947b2c + 88 4 Foundation
0x00000001827c8c3c + 36 5 UIKit
0x00000001870fcd98 + 64 6 UIKit
0x00000001870fd8b0 + 244 7 UIKit
0x000000018788b7f0 + 268 8 UIKit
0x0000000187308aa0 + 176 9 UIKit
0x0000000186ff01e4 + 656 10 QuartzCore
0x0000000184982994 + 148 11 QuartzCore
0x000000018497d5d0 + 292 12 QuartzCore
0x000000018497d490 + 32 13 QuartzCore
0x000000018497cac0 + 252 14 QuartzCore
0x000000018497c820 + 500 15 WebCore
0x0000000186b56270 + 176 16 WebCore
0x0000000186b18fa4 + 368 17 CoreFoundation
0x0000000181e4d09c + 24 18 CoreFoundation
0x0000000181e4cb30 + 540 19 CoreFoundation
0x0000000181e4a830 + 724 20 CoreFoundation
0x0000000181d74c50 CFRunLoopRunSpecific + 384 21 WebCore
0x0000000185d6261c + 456 22 libsystem_pthread.dylib
0x0000000181afbb28 + 156 23 libsystem_pthread.dylib
0x0000000181afba8c + 0 24 libsystem_pthread.dylib
0x0000000181af9028 thread_start + 4 )
The Code I use is:
let string = "<html style='margin:0;background:black;'><body style='margin:0;background:black;'><iframe style='position:absolue;top:0;left:0;margin:0;' width='\(webViewWidth)' height='\(webViewHeight)' src='\(src)' frameborder='0' allowfullscreen></iframe></body></html>"
webViewYT.loadHTMLString(string as String, baseURL: nil)
Looking online I found out that I have to encapsulate UI changes in a dispatch_async.
How can I resolve this issue?

crash on Unwind Segue after orientation change

I have an unwind segue which works fine in landscape or portrait on iOS 9.3, but throws the following exception if I rotate the device between presenting the target view controller (A) and the view controller performing the unwind (C).
Any ideas why this happens, and how to work around this problem?
A high level view of my storyboard:
The exception:
2016-03-28 16:58:14.194 ClarityLife[96444:11508887] *** Assertion failure in -[_UIStoryboardUnwindChain initFromSourceViewController:toDestinationViewController:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.60.7/UIStoryboardUnwindSegueTemplate.m:119
2016-03-28 16:58:14.202 ClarityLife[96444:11508887] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not unwind from <ClarityLife.VideoCallDisconnectingViewController: 0x7fdaa07c2b50> to <ClarityLife.VideoCallIdleViewController: 0x7fdaa2c13ab0> because a common ancestor could not be found. (Note that it is not supported to unwind from a view controller to one of its descendants.)'
*** First throw call stack:
(
0 CoreFoundation 0x000000011128bd85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000113f92deb objc_exception_throw + 48
2 CoreFoundation 0x000000011128bbea +[NSException raise:format:arguments:] + 106
3 Foundation 0x0000000111e93d5a -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
4 UIKit 0x0000000113384c97 -[_UIStoryboardUnwindChain initFromSourceViewController:toDestinationViewController:] + 908
5 UIKit 0x0000000113385e49 -[UIStoryboardUnwindSegueTemplate newDefaultPerformHandlerForSegue:] + 125
6 UIKit 0x000000011315e395 -[UIStoryboardSegueTemplate segueWithDestinationViewController:] + 431
7 UIKit 0x00000001133865b7 -[UIStoryboardUnwindSegueTemplate segueWithDestinationViewController:] + 631
8 UIKit 0x00000001133868ae -[UIStoryboardUnwindSegueTemplate _performWithDestinationViewController:sender:] + 120
9 UIKit 0x0000000113386808 -[UIStoryboardUnwindSegueTemplate _perform:] + 86
10 UIKit 0x0000000112bb45f8 -[UIViewController performSegueWithIdentifier:sender:] + 99
11 ClarityLife 0x000000010fa6f9c5 _TFC11ClarityLife36VideoCallDisconnectingViewController13viewDidAppearfSbT_ + 261
12 ClarityLife 0x000000010fa6fa21 _TToFC11ClarityLife36VideoCallDisconnectingViewController13viewDidAppearfSbT_ + 49
13 UIKit 0x0000000112bb7335 -[UIViewController _setViewAppearState:isAnimating:] + 830
14 UIKit 0x0000000112bb7cb8 -[UIViewController _endAppearanceTransition:] + 262
15 UIKit 0x0000000112b8208a -[UIPresentationController transitionDidFinish:] + 827
16 UIKit 0x0000000112d5f38f -[_UICurrentContextPresentationController transitionDidFinish:] + 42
17 UIKit 0x0000000112b857c1 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke_2 + 183
18 UIKit 0x00000001134444c8 -[_UIViewControllerTransitionContext completeTransition:] + 101
19 UIKit 0x0000000112b7ef77 -[UITransitionView notifyDidCompleteTransition:] + 252
20 UIKit 0x0000000112b7ec88 -[UITransitionView _didCompleteTransition:] + 1344
21 UIKit 0x0000000112b813f4 -[UITransitionView _transitionDidStop:finished:] + 104
22 UIKit 0x0000000112aa47ff -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 241
23 UIKit 0x0000000112aa4bae -[UIViewAnimationState animationDidStop:finished:] + 80
24 QuartzCore 0x00000001128c93c8 _ZN2CA5Layer23run_animation_callbacksEPv + 308
25 libdispatch.dylib 0x00000001160393eb _dispatch_client_callout + 8
26 libdispatch.dylib 0x00000001160211ef _dispatch_main_queue_callback_4CF + 1738
27 CoreFoundation 0x00000001111e50f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
28 CoreFoundation 0x00000001111a6b99 __CFRunLoopRun + 2073
29 CoreFoundation 0x00000001111a60f8 CFRunLoopRunSpecific + 488
30 GraphicsServices 0x0000000115ad5ad2 GSEventRunModal + 161
31 UIKit 0x0000000112a16f09 UIApplicationMain + 171
32 ClarityLife 0x000000010fa11432 main + 114
33 libdyld.dylib 0x000000011606d92d start + 1
34 ??? 0x0000000000000001 0x0 + 1
Resolved. The problem is in the app delegate method:
func splitViewController(splitViewController: UISplitViewController,
collapseSecondaryViewController secondaryViewController: UIViewController,
ontoPrimaryViewController primaryViewController: UIViewController) -> Bool {
...
return true
}
This method fell through to return true, which caused splitViewController to collapse the target view controller (A), which is the secondaryViewController, prior to the unwind. The solution is to ensure the secondary is not collapsed by returning false, thereby ensuring that the target of the unwind is available.

Resources