Thanks Jason, that did the trick. Took me a minute to figure out why my modal was being displayed again immediately after dismissing though. Then I remembered I was displaying it in ViewDidAppear() J
From: Jason Awbrey [mailto:[email protected]] Sent: Wednesday, April 25, 2012 10:10 AM To: Chris House Cc: [email protected] Subject: Re: [MonoTouch] Dismissing a modal viewcontroller The parent VC needs to dismiss the modal. The modal can't dismiss itself Sent from my iPad On Apr 25, 2012, at 9:03 AM, Chris House <[email protected]> wrote: I have an app with a single main viewcontroller. When the app loads, I would like this main viewcontroller to display a modal view that the user would use to login. Upon successfully logging in, the modal would be dismissed and the main view would be visible. I've added the following override for the main viewcontroller's ViewDidAppear method: public override void ViewDidAppear(bool animated) { LoginViewController loginController = new LoginViewController(); this.PresentModalViewController(loginController, true); } This part works great, the login view is displayed as expected. On the login view controller, I have an event handler for a button's TouchUpInside event. This handler calls a method that performs authentication using the credentials entered by the user. If authentication is successful, I have the following code to dismiss the modal: this.DismissModalViewControllerAnimated(true); The previous line of code executes without any exceptions, however the modal is never dismissed. Can anyone point me in the right direction here as to how I get the modal to be dismissed? Thanks! Chris _______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
_______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
