In a react native software share characteristic is carried out in ios native. UIDocumentInteraction controller is used to point out share window.
The under code is written as a motion selector for a UIBarButton.
@objc fileprivate func shareTapped(_ sender: UIBarButtonItem) {
if let pageURL = extractPageFromDocument(doc, forPageNumber: Int(pageIndex), withName: "share-report-page.pdf") {
documentInteractionController.url = pageURL
documentInteractionController.presentOptionsMenu(from: sender, animated: true)
}
}
The code is working completely tremendous when the debug executable is enabled in xcode scheme.
When debug executable enabled, this display appears.
Identical code is producing crash when working the app with debug executable disabled in xcode. Crash log is under.
*** Terminating app as a result of uncaught exception 'NSInvalidArgumentException', purpose: '-[SHSheetPresenter applyOptionsOnWillMoveToParentViewController:]: unrecognized selector despatched to occasion 0x6000038bea00'
*** First throw name stack:
(
0 CoreFoundation 0x0000000114423531 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x0000000110ea37e8 objc_exception_throw + 48
2 CoreFoundation 0x0000000114438643 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3 CoreFoundation 0x0000000114427cc4 ___forwarding___ + 1459
4 CoreFoundation 0x0000000114429ec8 _CF_forwarding_prep_0 + 120
5 OneViewNew 0x00000001059161b5 -[UIViewController(LayoutProtocol) willMoveToParentViewController:] + 133
6 UIKitCore 0x0000000137be2b6c -[UIViewController _addChildViewController:performHierarchyCheck:notifyWillMove:] + 691
7 UIKitCore 0x0000000137afde44 -[UINavigationController pushViewController:transition:forceImmediate:] + 1782
8 UIKitCore 0x0000000137afd594 -[UINavigationController pushViewController:animated:] + 992
9 ShareSheet 0x000000012ae7fa2a -[SHSheetRouter presentMainViewController:withNavigationControllerSupport:] + 252
10 ShareSheet 0x000000012ae33707 -[SHSheetPresenter prepareViewIfNeeded] + 714
11 ShareSheet 0x000000012ae1a7ca -[UIActivityViewController viewDidLoad] + 110
12 UIKitCore 0x0000000137bd7e1a -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 80
13 UIKitCore 0x0000000137bddf12 -[UIViewController loadViewIfRequired] + 1342
14 UIKitCore 0x0000000137bde2f9 -[UIViewController view] + 27
15 UIKitCore 0x0000000137bf690c -[UIViewController _setPresentationController:] + 92
16 UIKitCore 0x0000000137bee745 -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1472
17 UIKitCore 0x0000000137bf20b1 -[UIViewController _presentViewController:withAnimationController:completion:] + 4488
18 CoreFoundation 0x000000011442a15c __invoking___ + 140
19 CoreFoundation 0x0000000114427483 -[NSInvocation invoke] + 302
20 UIKitCore 0x0000000137bebd8e -[UIViewController _endDelayingPresentation] + 441
21 ShareSheet 0x000000012ae1b5f2 -[UIActivityViewController _endDelayingPresentation] + 229
22 ShareSheet 0x000000012ae0a656 -[SHSheetScene scene:didReceiveActions:] + 589
23 FrontBoard 0x000000012d082630 -[FBSceneObserver scene:didReceiveActions:] + 104
24 FrontBoard 0x000000012d080457 __57-[FBSceneWorkspace scene:didReceiveActions:forExtension:]_block_invoke + 1212
25 BaseBoard 0x000000011f19770c -[BSEventQueue _processNextEvent] + 294
26 BaseBoard 0x000000011f197b5d -[BSEventQueue executeOrInsertEvents:atPosition:] + 778
27 BaseBoard 0x000000011f1977fc -[BSEventQueue executeOrInsertEvent:atPosition:] + 112
28 FrontBoard 0x000000012d07c829 -[FBSceneWorkspace _executeNextIdleEventIfAppropriate] + 303
29 FrontBoard 0x000000012d07c6ed -[FBSceneWorkspace _executeEventWhenIdle:] + 98
30 FrontBoard 0x000000012d07fe55 -[FBSceneWorkspace scene:didReceiveActions:forExtension:] + 684
31 libdispatch.dylib 0x0000000114f643ec _dispatch_call_block_and_release + 12
32 libdispatch.dylib 0x0000000114f656d8 _dispatch_client_callout + 8
33 libdispatch.dylib 0x0000000114f7448c _dispatch_main_queue_drain + 1420
34 libdispatch.dylib 0x0000000114f73ef2 _dispatch_main_queue_callback_4CF + 31
35 CoreFoundation 0x000000011437faf4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
36 CoreFoundation 0x000000011437a42f __CFRunLoopRun + 2463
37 CoreFoundation 0x00000001143796ad CFRunLoopRunSpecific + 557
38 GraphicsServices 0x000000011f92e08f GSEventRunModal + 137
39 UIKitCore 0x00000001385c8ad1 -[UIApplication _run] + 972
40 UIKitCore 0x00000001385cd551 UIApplicationMain + 123
41 OneViewNew 0x0000000104d5cf1f fundamental + 63
42 dyld 0x00000001103023e0 start_sim + 10
43 ??? 0x0000000207bf8345 0x0 + 8719926085
)
libc++abi: terminating as a result of uncaught exception of kind NSException
Tried debugging with exception breakpoint and debugger hit on the under place at “UIViewController+LayoutProtocol” earlier than crash.
(https://i.sstatic.internet/QG9FrjnZ.png)
Self.presenter worth right here is:
<SHSheetPresenter: 0x7fa3569125f0>
and resolveOptions is nil.