I am trying to show my "ProtectedViewController".
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let controller: UIViewController = storyboard.instantiateViewController(withIdentifier: "Protected") as! ProtectedPageViewController
self.present(controller, animated: true, completion: nil)
When i try to display it error pops on the step
self.present(controller, animated: true, completion: nil)
as on Screenshot below:
Code below isn't working too:
let pvc = ProtectedPageViewController()
self.present(pvc, animated: true, completion: nil)
The same error.Have tried everything.
Error from stack trace:
*** First throw call stack:
(
0 CoreFoundation 0x0000000108a2c34b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010807021e objc_exception_throw + 48
2 CoreFoundation 0x0000000108a30442 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000107c06edd -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 UIKit 0x0000000109be1942 -[UIKeyboardTaskQueue waitUntilAllTasksAreFinished] + 165
5 UIKit 0x000000010934ec14 -[UIKeyboardImpl setDelegate:force:] + 1404
6 UIKit 0x0000000109776152 -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:] + 981
7 UIKit 0x000000010977f95c -[UIPeripheralHost(UIKitInternal) _preserveInputViewsWithId:animated:reset:] + 498
8 UIKit 0x00000001092409b7 -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1178
9 UIKit 0x0000000109242702 -[UIViewController _presentViewController:withAnimationController:completion:] + 4971
10 UIKit 0x00000001092456df -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 530
11 UIKit 0x00000001092451c5 -[UIViewController presentViewController:animated:completion:] + 179
12 Registration 0x0000000107a7208a _TFFC12Registration23LoginPageViewController17loginButtonTappedFPs9AnyObject_T_U_FTGSqV10Foundation4Data_GSqCSo11URLResponse_GSqPs5Error___T_ + 3482
13 Registration 0x0000000107a695fb _TTRXFo_oGSqV10Foundation4Data_oGSqCSo11URLResponse_oGSqPs5Error____XFdCb_dGSqCSo6NSData_dGSqS1__dGSqCSo7NSError___ + 203
14 CFNetwork 0x000000010b8756b0 __75-[__NSURLSessionLocal taskForClass:request:uploadFile:bodyData:completion:]_block_invoke + 19
15 CFNetwork 0x000000010b874f5c __49-[__NSCFLocalSessionTask _task_onqueue_didFinish]_block_invoke + 308
16 Foundation 0x0000000107b742cd __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
17 Foundation 0x0000000107b73faf -[NSBlockOperation main] + 101
18 Foundation 0x0000000107b726ac -[__NSOperationInternal _start:] + 672
19 Foundation 0x0000000107b6e5ef __NSOQSchedule_f + 201
20 libdispatch.dylib 0x000000010c2600cd _dispatch_client_callout + 8
21 libdispatch.dylib 0x000000010c23de6b _dispatch_queue_serial_drain + 236
22 libdispatch.dylib 0x000000010c23eb9f _dispatch_queue_invoke + 1073
23 libdispatch.dylib 0x000000010c2413b7 _dispatch_root_queue_drain + 720
24 libdispatch.dylib 0x000000010c24108b _dispatch_worker_thread3 + 123
25 libsystem_pthread.dylib 0x000000010c60a712 _pthread_wqthread + 1299
26 libsystem_pthread.dylib 0x000000010c60a1ed start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Please help me to find the way to fix it.
Thanks in advance!!!
P.S.: Using iOS 10.0 and Swift 3
The stacktrace shows something in NSURLSession context. Are you presenting the ViewController from within the main thread, or from some worker thread?
Please check if executing your presentation call from the main thread succeeds:
DispatchQueue.main.async {
// here your presentation call, e.g.
self.present(controller, animated: true, completion: nil)
}
If not, you should post the complete exception (from the output window) and/or a little more code (more of the area you present the controller)
Related
I am getting the following error when pushing a view controller onto the stack:
Thread 1: Exception: "<UINavigationController: 0x7f9345817a00> is pushing the same view controller instance (<xxxx.HelpViewController: 0x7f9346143390>) more than once which is not supported and is most likely an error in the application : com.xxx.xxx1"
I am calling the view controller from a table view controller with the following code:
let myVC = self.storyboard?.instantiateViewController(identifier: "HelpViewController") as! HelpViewController
// pass any parms here
myVC.stringPassed = label!.text!
navigationController?.pushViewController(myVC, animated: true)
self.navigationController!.pushViewController(myVC, animated: false)
I have only one copy of the view controller and this is the first time I am pushing this view onto the stack.
Any help would be appreciated.
Here is the log:
2020-08-13 17:42:45.289742-0500 NCLEX[29470:2944371] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '<UINavigationController: 0x7f94e980ce00> is pushing the same view controller instance (<xxx.HelpViewController: 0x7f94e54634a0>) more than once which is not supported and is most likely an error in the application : com.xxx.xxx'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23e3de6e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff512539b2 objc_exception_throw + 48
2 UIKitCore 0x00007fff48be2df6 -[UINavigationController pushViewController:transition:forceImmediate:] + 451
3 UIKitCore 0x00007fff48be2a9f -[UINavigationController pushViewController:animated:] + 669
4 UIKitCore 0x00007fff48ca880d -[_UIViewControllerTransitionCoordinator _applyBlocks:releaseBlocks:] + 294
5 UIKitCore 0x00007fff48ca495b -[_UIViewControllerTransitionContext _runAlongsideCompletions] + 126
6 UIKitCore 0x00007fff48ca46cf -[_UIViewControllerTransitionContext completeTransition:] + 106
7 UIKitCore 0x00007fff48cb6e1f __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke.158 + 806
8 UIKitCore 0x00007fff4982093c -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 671
9 UIKitCore 0x00007fff497f15c9 -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 220
10 UIKitCore 0x00007fff497f1bc0 -[UIViewAnimationState animationDidStop:finished:] + 276
11 UIKitCore 0x00007fff497f1d46 -[UIViewAnimationState animationDidStop:finished:] + 666
12 QuartzCore 0x00007fff2b4fbadc _ZN2CA5Layer23run_animation_callbacksEPv + 306
13 libdispatch.dylib 0x0000000110475e8e _dispatch_client_callout + 8
14 libdispatch.dylib 0x0000000110483d97 _dispatch_main_queue_callback_4CF + 1149
15 CoreFoundation 0x00007fff23da1869 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
16 CoreFoundation 0x00007fff23d9c3b9 __CFRunLoopRun + 2041
17 CoreFoundation 0x00007fff23d9b8a4 CFRunLoopRunSpecific + 404
18 GraphicsServices 0x00007fff38c39bbe GSEventRunModal + 139
19 UIKitCore 0x00007fff49325968 UIApplicationMain + 1605
20 NCLEX 0x000000010f37007b main + 75
21 libdyld.dylib 0x00007fff520ce1fd start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
You need to comment 1 line from these 2 mostly the second 1 if you don't need an animation
navigationController?.pushViewController(myVC, animated: true)
self.navigationController!.pushViewController(myVC, animated: false)
as they do the same thing which is pushing the same vc twice that causes the crash
This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 4 years ago.
I am trying to move from SignInViewController to RegisterUserViewController on button click .Here is code
#IBAction func RegisterNewAccountButtonTapped(_ sender: Any) {
print("Register account button tapped")
//RegisterUserViewController
// let storyboard = UIStoryboard(name: "SignInViewController", bundle: nil)
let vc = self.storyboard?.instantiateViewController(withIdentifier: "RegisterUserViewController") as! RegisterUserViewController
self.present(vc, animated: true)
}
Here in this picture are the class and storyboard id
Here is error that is coming on pressing Register New Account button .
2018-04-27 06:09:24.720143-0700 UserRegistrationExample[10193:1788611] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UserRegistrationExample.RegisterUserViewController 0x7f84b4f171b0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key repeatPasswordTextField.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010db1826b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010a1fbf41 objc_exception_throw + 48
2 CoreFoundation 0x000000010db181b9 -[NSException raise] + 9
3 Foundation 0x0000000109c20883 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
4 UIKit 0x000000010a95dd56 -[UIViewController setValue:forKey:] + 87
5 UIKit 0x000000010ac3ac94 -[UIRuntimeOutletConnection connect] + 109
6 CoreFoundation 0x000000010dabb61d -[NSArray makeObjectsPerformSelector:] + 317
7 UIKit 0x000000010ac3964a -[UINib instantiateWithOwner:options:] + 1856
8 UIKit 0x000000010a964d49 -[UIViewController _loadViewFromNibNamed:bundle:] + 383
9 UIKit 0x000000010a965652 -[UIViewController loadView] + 177
10 UIKit 0x000000010a965983 -[UIViewController loadViewIfRequired] + 195
11 UIKit 0x000000010a9661e0 -[UIViewController view] + 27
12 UIKit 0x000000010b3bd39d -[_UIFullscreenPresentationController _setPresentedViewController:] + 89
13 UIKit 0x000000010a936a8f -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 133
14 UIKit 0x000000010a979338 -[UIViewController _presentViewController:withAnimationController:completion:] + 3808
15 UIKit 0x000000010a97c14a __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 134
16 UIKit 0x000000010a97c5ea -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 532
17 UIKit 0x000000010a97c086 -[UIViewController presentViewController:animated:completion:] + 181
18 UserRegistrationExample 0x00000001098e0ae5 _T023UserRegistrationExample20SignInViewControllerC30RegisterNewAccountButtonTappedyypF + 1077
19 UserRegistrationExample 0x00000001098e0c58 _T023UserRegistrationExample20SignInViewControllerC30RegisterNewAccountButtonTappedyypFTo + 72
20 UIKit 0x000000010a7cd631 -[UIApplication sendAction:to:from:forEvent:] + 83
21 UIKit 0x000000010a942000 -[UIControl sendAction:to:forEvent:] + 67
22 UIKit 0x000000010a94231d -[UIControl _sendActionsForEvents:withEvent:] + 450
23 UIKit 0x000000010a94124a -[UIControl touchesEnded:withEvent:] + 618
24 UIKit 0x000000010a840bf1 -[UIWindow _sendTouchesForEvent:] + 2807
25 UIKit 0x000000010a842314 -[UIWindow sendEvent:] + 4124
26 UIKit 0x000000010a7e82da -[UIApplication sendEvent:] + 352
27 UIKit 0x000000010b0f6f18 __dispatchPreprocessedEventFromEventQueue + 2809
28 UIKit 0x000000010b0f9a7f __handleEventQueueInternal + 5957
29 CoreFoundation 0x000000010dabb351 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
30 CoreFoundation 0x000000010db5ad71 __CFRunLoopDoSource0 + 81
31 CoreFoundation 0x000000010da9fcb9 __CFRunLoopDoSources0 + 185
32 CoreFoundation 0x000000010da9f29f __CFRunLoopRun + 1279
33 CoreFoundation 0x000000010da9eb29 CFRunLoopRunSpecific + 409
34 GraphicsServices 0x00000001101af9c6 GSEventRunModal + 62
35 UIKit 0x000000010a7cb9a4 UIApplicationMain + 159
36 UserRegistrationExample 0x00000001098deee7 main + 55
37 libdyld.dylib 0x000000010ec3a621 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I have visited the following links but non of them solved the problem
https://coderwall.com/p/cjuzng/swift-instantiate-a-view-controller-using-its-storyboard-name-in-xcode
instantiateViewControllerWithIdentifier - Storyboard id set but still not working
Present View Controller in Storyboard with a Navigation Controller - Swift
Swift 3, Xcode 8 Instantiate View Controller is not working
Instantiate and Present a viewController in Swift
How to remove this error.
You can download the code from this link
.https://drive.google.com/open?id=1yUaKeI6ZQphN7CsoiaeF2p4TmW_B5-9u
Try CTRL and drag from your button to the next ViewController. Then select "show". This is how you set a segue. Then click on the segue and give him an identifier. Then you need to set the
performSegue(withIdentifier: String, sender: self)
Have you tried this?
Can't replicate a crash on iOS 11 devices when deallocating the DetailViewController.
The app has a DetailViewController which inherits from the BaseViewController. DetailViewController has a DetailViewModel property.
DetailViewController, BaseViewController and DetailViewModel are all written in Objective-C. I upgraded the Swift version to Swift 4 and added a Swift Extension to DetailViewModel.
#objc extension DetailViewModel {
func foo() {
let conclusionBlock: (() -> Void) = { [weak self] in
guard let strongSelf = self else { return }
strongSelf.viewController.reloadData()
}
let viewModel = OtherViewModel(conclusionBlock: conclusionBlock)
let otherViewController = OtherViewController.make(viewModel: viewModel)
let nav = UINavigationController(rootViewController: otherViewController)
nav.modalPresentationStyle = .fullScreen
viewController.present(nav, animated: true, completion: nil)
}
}
Looking at the logs, func foo() in the DetailViewModel swift extension is not called and it's still crashing on dealloc.
Has anyone got ideas as to what's the issue or how to fix it?
Thank you
stack trace:
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x18589d7f4 objc_object::release() + 16
1 CoreFoundation 0x1862f3108 cow_cleanup + 112
2 CoreFoundation 0x18623a51c -[__NSArrayM dealloc] + 68
3 libobjc.A.dylib 0x18587eef4 object_cxxDestructFromClass(objc_object*, objc_class*) + 148
4 libobjc.A.dylib 0x18588c638 objc_destructInstance + 88
5 libobjc.A.dylib 0x18588c690 object_dispose + 16
6 AppName 0x100c7dbec -[DetailViewModel .cxx_destruct] (DetailViewModel.m:43)
7 libobjc.A.dylib 0x18587eef4 object_cxxDestructFromClass(objc_object*, objc_class*) + 148
8 libobjc.A.dylib 0x18588c638 objc_destructInstance + 88
9 libobjc.A.dylib 0x18588c690 object_dispose + 16
10 AppName 0x100cbe358 -[DetailViewController .cxx_destruct] (DetailViewController.m:103)
11 libobjc.A.dylib 0x18587eef4 object_cxxDestructFromClass(objc_object*, objc_class*) + 148
12 libobjc.A.dylib 0x18588c638 objc_destructInstance + 88
13 libobjc.A.dylib 0x18588c690 object_dispose + 16
14 UIKit 0x18fb338f4 -[UIResponder dealloc] + 156
15 UIKit 0x18f8e9e7c -[UIViewController dealloc] + 1776
16 AppName 0x100c9b66c -[BaseViewController dealloc] (BaseViewController.m:56)
17 AppName 0x100cb6570 -[DetailViewController dealloc] (DetailViewController.m:261)
18 UIKit 0x18f9d3ec4 __destroy_helper_block_.150 + 80
19 libsystem_blocks.dylib 0x185d91a60 _Block_release + 160
20 UIKit 0x18fa5f5bc -[UIViewAnimationBlockDelegate .cxx_destruct] + 72
21 libobjc.A.dylib 0x18587eef4 object_cxxDestructFromClass(objc_object*, objc_class*) + 148
22 libobjc.A.dylib 0x18588c638 objc_destructInstance + 88
23 libobjc.A.dylib 0x18588c690 object_dispose + 16
24 CoreFoundation 0x18623d998 -[__NSDictionaryI dealloc] + 136
25 libobjc.A.dylib 0x18589e138 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 836
26 CoreFoundation 0x186232050 _CFAutoreleasePoolPop + 28
27 CoreFoundation 0x186311b04 __CFRunLoopRun + 2020
28 CoreFoundation 0x1862322d8 CFRunLoopRunSpecific + 436
29 GraphicsServices 0x1880c3f84 GSEventRunModal + 100
30 UIKit 0x18f7df880 UIApplicationMain + 208
31 AppName 0x100d59540 main (main.m:10)
32 libdyld.dylib 0x185d5656c start + 4
To help with replicating the issue, try turning on Address Sanitizer in Xcode 9.
You have an object stored in an array that is over-released when the object is destroyed and is releasing its array.
You can first activate zombie objects (clic your target near the PLAY button, choose scheme/Run/Diagnostics/Zombie objects). in this mode, objects are not really released, so you can query the object causing the crash to see what is its type and begin to track it.
My app is crashing (only for some users) when they click on Share. This is the code:
#IBAction func btnShare(sender: AnyObject) {
let message = "Some message"
let shareUrl = "mydomain://someurl/\(someid)"
if let url = NSURL(string: shareUrl) {
let objectsToShare = [message, url]
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
activityVC.excludedActivityTypes = [UIActivityTypeAirDrop, UIActivityTypeAddToReadingList]
activityVC.popoverPresentationController?.sourceView = sender as! UIView
self.presentViewController(activityVC, animated: true, completion: nil)
}
}
This is the crash report:
Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x184a32014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x184af9460 pthread_kill + 112
2 libsystem_c.dylib 0x1849a63f4 abort + 140
3 libswiftCore.dylib 0x100d83928 swift::fatalError(char const*, ...) + 50
4 libswiftCore.dylib 0x100d6c0f0 swift::swift_dynamicCastFailure(void const*, char const*, void const*, char const*, char const*) + 70
5 libswiftCore.dylib 0x100d6c180 swift::swift_dynamicCastFailure(swift::Metadata const*, swift::Metadata const*, char const*) + 142
6 libswiftCore.dylib 0x100d92460 swift_dynamicCastObjCClassUnconditional + 68
7 Wize 0x100117198 specialized MyViewController.btnShare(AnyObject) -> () (MyViewController.swift:363)
8 Wize 0x1001132b0 #objc MyViewController.btnShare(AnyObject) -> () (MyViewController.swift)
9 UIKit 0x18b8e27b0 -[UIApplication sendAction:to:from:forEvent:] + 96
10 UIKit 0x18ba565ec -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 168
11 UIKit 0x18b8e27b0 -[UIApplication sendAction:to:from:forEvent:] + 96
12 UIKit 0x18b8e2730 -[UIControl sendAction:to:forEvent:] + 80
13 UIKit 0x18b8ccbe4 -[UIControl _sendActionsForEvents:withEvent:] + 452
14 UIKit 0x18b8ccd4c -[UIControl _sendActionsForEvents:withEvent:] + 812
15 UIKit 0x18b8e201c -[UIControl touchesEnded:withEvent:] + 584
16 UIKit 0x18b8e1b44 -[UIWindow _sendTouchesForEvent:] + 2484
17 UIKit 0x18b8dcd8c -[UIWindow sendEvent:] + 2988
18 UIKit 0x18b8ad858 -[UIApplication sendEvent:] + 340
19 UIKit 0x18c09acb8 __dispatchPreprocessedEventFromEventQueue + 2736
20 UIKit 0x18c094720 __handleEventQueue + 784
21 CoreFoundation 0x185a12278 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
22 CoreFoundation 0x185a11bc0 __CFRunLoopDoSources0 + 524
23 CoreFoundation 0x185a0f7c0 __CFRunLoopRun + 804
24 CoreFoundation 0x18593e048 CFRunLoopRunSpecific + 444
25 GraphicsServices 0x1873c1198 GSEventRunModal + 180
26 UIKit 0x18b918628 -[UIApplication _run] + 684
27 UIKit 0x18b913360 UIApplicationMain + 208
28 Wize 0x1001208f4 main (AppDelegate.swift:19)
29 libdispatch.dylib 0x1849205b8 (Missing)
Any idea what may be going on? It works fine for half the users.
To check the sender before converting it:
guard let sourceView = sender as? UIView else {
return
}
...
activityVC.popoverPresentationController?.sourceView = sourceView
For this below line
activityVC.popoverPresentationController?.sourceView = sender as! UIView
add this line
if let senderSourceView = sender as? UIView {
activityVC.popoverPresentationController?.sourceView = senderSourceView
}else{
//Here not getting UIView
}
It's possible App crash because if UIView not get for sourceView.It is work if right as i said.
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.