NOE What am I missing here?

Self is not Nil so what is?

What is the Super of AuthScreen?

Probably a window.

Window name appears as that (Window1.Window1)…

If so I guess the Window.Constructor of the Super class wasn’t called yet?

No message text on the exception.

Within the constructor of a Window, things are not set up enough to be shown.

This has been happening a lot with my users (NOE within ShowModal) since c. 2021r1 or thereabouts. I haven’t been able to reproduce it myself, so I am keen to hear what the issue turns out to be.

The same code worked fine when compiled with earlier versions of Xojo.

AuthScreen is a MobileScreen.

This is the code that runs to execute the method where the NOE exists.

#If TargetDesktop
  AuthUI = New AuthWindow
#ElseIf TargetIOS
  AuthUI = New AuthScreen
#Endif

Var TempCode As String = AuthUI.GetTempKey(BuildAuthorizeUrl())
ExchangeCodes(TempCode)

AuthUI is a Class Interface that specifies the GetTempKey method.

Just a thought… any iOSTabBar or iOSSplitView in use?
If so, the docs for mobilescreen.showmodal say you’ll need to pass as the parent parameter the MobileScreen in front of which you wish the modal dialog to appear.

ShowModal(parent As MobileScreen, style As ModalPresentationStyles = MobileScreen, animate As Boolean = True)

Thanks @Chay_Wesley parent is nil.

The root cause of the issue was that I was showing this modal screen from the App.Opening event so there was no screen to show it over yet.

Oddly, (trust me) I was going to suggest that, but knowing that Showmodal works fine in desktop when used in the app Open event, I figured the response would get laughed at.
Glad it worked out. :slight_smile: