NavigationController.PopViewController not popping top view controller

Jacob D 1 Reputation point
2021-07-24T00:50:48.757+00:00

Hello,
I have a Xamarin.iOS project where at some point I call NavigationController.PopViewController(true);
However, the view which I'm trying to pop doesn't go away. It's as if PopViewController isn't doing anything
The NavigationController isn't null, and it has two elements on its stack. The presenting view controller is a UIAlertController that isn't on the stack.
The issue doesn't always happen, but it's pretty easily reproduceable

117583-screen-shot-2021-07-23-at-84549-pm.png
The issue exists even with the most recent version of Xamarin.Forms.

I notice that (unsurprisingly) in the cases that the view is dismissed, the ViewWillDisappear method is invoked. But it isn't called when the view isn't dismissed

Any ideas what might be going wrong? Any chance I'm doing something wrong?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,349 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.