Getting lost in how things are “supposed” to be done in iOS. A couple basic questions…
In normal .NET we can create forms (views) and raise them as dialogs through ShowDialog() which returns a value, etc. I want to accomplish the same idea with iOS using MonoTouch.
- Is
this.Add(myNewView);the correct way to show a view on top of the current view (like a dialog?) - How do you close it once the work has been done? (.NET equivalent of
this.Close();)?
The most similar thing to .NET ShowDialog(), is to present modal view controllers.
To do this, call the PresentModalViewController method of the parent controller that will display the view:
To hide/dismiss it, call the DismissModalViewControllerAnimated method on the controller that is displayed:
The boolean parameters indicate whether you want to animate the presentation/dismissal.