iOS Question IOS Navigation problem

DickD

Active Member
Licensed User
I have written several ios modules now that use navigation without a problem. However in this new pair of modules I get an error message when ending the FindUser module and returning to StartSearch. The error is: "Object was not initialized (UINavigationController)". I have tried it with and without the sl.init statement in Sub Show.

About the only difference is that in the modules that worked they were starting from and returning to the Main module. In this example the StartSearch module is called from Main and then calls FindUsers. Should this make a difference?

B4X:
'in module StartSearch
Sub Start
 SL.Initialize("SL")
 Main.Page1.ResignFocus
 SL.RootPanel.LoadLayout("SearchListen")
 Main.NavControl.ShowPage(SL)
 MakeButtons(NavControl)
 Log("IN StartSearch start")
 FindUser.Start()
End Sub

Sub Show
' SL.intialize("SL")
 NavControl.ShowPage(SL) 'error message points to this line
End Sub

B4X:
'in FindUser module
Sub Start
 FU.Initialize("FU")
 SL.ResignFocus
 FU.RootPanel.LoadLayout("FUDummy")
 Main.NavControl.ShowPage(FU)
 DoSomething
end sub

Sub DoSomething
 ....
 if matches = 0 then
 msgbox("No matches found","")
 FU.resignfocuse
 StartSearch.show 'error occurs when calling this line
 end if
end sub
 

DickD

Active Member
Licensed User
I have written several ios modules now that use navigation without a problem. However in this new pair of modules I get an error message when ending the FindUser module and returning to StartSearch. The error is: "Object was not initialized (UINavigationController)". I have tried it with and without the sl.init statement in Sub Show.

About the only difference is that in the modules that worked they were starting from and returning to the Main module. In this example the StartSearch module is called from Main and then calls FindUsers. Should this make a difference?

B4X:
'in module StartSearch
Sub Start
SL.Initialize("SL")
Main.Page1.ResignFocus
SL.RootPanel.LoadLayout("SearchListen")
Main.NavControl.ShowPage(SL)
MakeButtons(NavControl)
Log("IN StartSearch start")
FindUser.Start()
End Sub

Sub Show
' SL.intialize("SL")
NavControl.ShowPage(SL) 'error message points to this line
End Sub

B4X:
'in FindUser module
Sub Start
FU.Initialize("FU")
SL.ResignFocus
FU.RootPanel.LoadLayout("FUDummy")
Main.NavControl.ShowPage(FU)
DoSomething
end sub

Sub DoSomething
....
if matches = 0 then
msgbox("No matches found","")
FU.resignfocuse
StartSearch.show 'error occurs when calling this line
end if
end sub
NeverMind. In Sub show I added Main to Main.NavControl.Showpage and it works.
 
Upvote 0
Top