I’ve got a module method that’s called from lots of views many times to progress through my app:
[code]Public Sub GoToView(mview As iOSView)
If iOSSplitView.Available Then
Dim split As New iOSSplitView
split.Master = mview
Dim detail As New FormView
split.Detail = detail
App.CurrentScreen.Content = split
Else
App.CurrentScreen.Content = mview
End If
End Sub
[/code]
The detail view “FormView” doesn’t change but I want it to update its content. So I would like to figure out a way to do that instead of changing the detail view. Something like:
[code]Public Sub GoToView(mview As iOSView)
If iOSSplitView.Available Then
Self.ParentSplitView.Master = mview
FormView(Self.ParentSplitView.Detail).UpdateForm
Else
App.CurrentScreen.Content = mview
End If
End Sub
[/code]
But “Self” can’t be used in a module method. How does one access the ParentSplitView from a module method?
[quote=485434:@Art Gorski]I can’t find in the docs where
Return iOSSplitView(mSplitView)
iOSSplitView can take a parameter. Confused.[/quote]
Its a type cast. Since the actual variable is a Weakref and you want to return a Splitview instance.
To change a view, the only way to do this that I can see (besides PushTo, which isn’t appropriate in my case) is to use:
App.CurrentScreen.Content
Unfortunately, in the case of a splitview, it will change both the master and detail. I wanted to just change the master, so it seems like I am out of luck.
Then another solution is to design everything in iOS Container Controls.
You can then add them to the view or remove them when they aren’t needed. This would keep the detail view the way it is.
However, I remember a bug that made the app crash when removing a containerControl. I don’t know if it is fixed as I worked around it at the time and never checked again.
My interest in not changing a view if I don’t have to is random crashes in my app that I haven’t been able to track down to a specific thing. I am wondering if there’s a memory leak that eventually causes this as the user pounds on the app.
In other apps, I have a simple view with a Title and iOSTable. So there I just change the title and iOSTableDataSource for the table and keep the same view.