I have a relatively simple application that has master-detail form type navigation that contains a list of pdf documents. When I select a document I open it with the sfPdfViewer embedded into the page. The application displays the modal form at the start and then navigates to the master detail page. So the navigation logic is like this:
Root Page -> open Doc List page -> open modal dialog -> close modal dialog -> select document -> open pdf viewer page
It works perfectly fine for the first time in iOS and works all the time in Android,however when I try to go through the cycle again in the iOS or even when I try to go like this:
Root Page -> open DocList page -> open modal dialog -> close modal dialog -> navigate to another page -> open DocList page -> open modal dialog -> close modal dialog-> open pdf viewer page it crashes with the message:
Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: There can only be one UIMenuController instance.
Native stack trace:
0 CoreFoundation 0x000000010f7ad1cb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000011ce78f41 objc_exception_throw + 48
2 CoreFoundation 0x000000010f7b2362 +[NSException raise:format:arguments:] + 98
3 Foundation 0x00000001103d8089 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 UIKit 0x0000000113d9f121 -[UIMenuController init] + 227
5 DFK.iOS 0x000000010f10ef49 xamarin_dyn_objc_msgSend + 217
6 ??? 0x000000013c8ba863 0x0 + 5310752867
7 ??? 0x000000013fcc68a6 0x0 + 5365328038
8 ??? 0x000000013d38ea5a 0x0 + 5322107482
9 ??? 0x000000013d38df18 0x0 + 5322104600
10 ??? 0x000000013d38df18 0x0 + 5322104600
11 ??? 0x000000013d38df18 0x0 + 5322104600
I isolated it to the PDF viewer component. I'm also using SfListView component and it works fine.
I'm using VisualStudio for Mac, the emulator is on iOS 11 and I've just upgrade the sfPdfViewer component to the latest version 15.3.0.33