MasterDetailPage Crash on iPad

MFMFMFMF USMember

ttps://github.com/xamarin/xamarin-forms-samples/tree/master/Navigation/MasterDetailPage

When MasterDetailPage.Master hid,
I want to disable the gesture to reveal the master page.

So, I added the following code.

MainPage.xaml.cs

        public MainPage()
        {
            InitializeComponent();

            // Add
            this.IsPresentedChanged += OnPresentedChanged;

            masterPage.ListView.ItemSelected += OnItemSelected;

            if (Device.RuntimePlatform == Device.Windows)
            {
                MasterBehavior = MasterBehavior.Popover;
            }
        }

        // Add
        private void OnPresentedChanged(object sender, System.EventArgs args)
        {
            this.IsGestureEnabled = this.IsPresented;
        }

However, the app crashes by specific gesture on iPad.
In particular
1, MasterDetailPage.Master is presented.
2, Drag gesture from right to left on detail area.(Then, master hid.)
3, While keeping touch down, drag gesture from left to right on detail area.(Then, app crash!)

Crashlog

Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0

Filtered syslog:
None found

Last Exception Backtrace:
0 CoreFoundation 0x184259900 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x1838c7f80 objc_exception_throw + 56
2 CoreFoundation 0x184259848 +[NSException raise:format:] + 120
3 UIKit 0x189716704 -[UIPopoverController _presentPopoverBySlidingIn:fromEdge:ofView:animated:stateOnly:notifyDelegate:] + 276
4 UIKit 0x189717c2c -[UIPopoverController _presentPopoverFromEdge:ofView:animated:] + 420
5 UIKit 0x18971cb5c -[UIPopoverController _swipe:] + 736
6 UIKit 0x1894ccdbc _UIGestureRecognizerSendTargetActions + 164
7 UIKit 0x1890f05b8 _UIGestureRecognizerSendActions + 172
8 UIKit 0x188f7e9b0 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 784
9 UIKit 0x1894ce3bc ___UIGestureRecognizerUpdate_block_invoke904 + 72
10 UIKit 0x188f3db58 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 372
11 UIKit 0x188f3a8dc _UIGestureRecognizerUpdate + 2404
12 UIKit 0x188f7c820 -[UIWindow _sendGesturesForEvent:] + 1132
13 UIKit 0x188f7be1c -[UIWindow sendEvent:] + 764
14 UIKit 0x188f4c4cc -[UIApplication sendEvent:] + 248
15 UIKit 0x188f4a794 _UIApplicationHandleEventQueue + 5528

Build Version

Xcode : 9.0
Visual Studio Community 2017 for Mac : 7.1.5
Mono : 5.2.0.224
Xamarin.Forms : 2.3.4.270
Xamarin.iOS : 11.0.0.0

Do you have any ideas how to avoid crash ?
Thank you.

Sign In or Register to comment.