[MonoTouch] How to use "PresentModalViewController"

Kevin Daly kevindaly at xtra.co.nz
Mon Oct 5 06:00:30 EDT 2009


I'm currently using a bit of code like this successfully:

login = new LoginController();
login.ModalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
navigationController.PresentModalViewController(login,true);
login.ButtonPressed+=(sender,args)=>
{
	RequestData();
	navigationController.DismissModalViewControllerAnimated(true);
}


...where the lines featuring navigationController (the instance variable for
my NavigationController) are the most relevant.

When I first tried this I had the whole thing in a "using" block, and spent
almost a week trying to work out why nothing was happening - then I realised
that nothing was waiting for the ModalViewController to do anything before
proceeding, so it was effectively being dismissed and destroyed immediately.
I'd been fooled by my expectations from working with modal dialogs in
Windows Forms.

-----Original Message-----
From: monotouch-bounces at lists.ximian.com
[mailto:monotouch-bounces at lists.ximian.com] On Behalf Of Adam Langley
Sent: Monday, 5 October 2009 9:41 p.m.
To: monotouch at lists.ximian.com
Subject: [MonoTouch] How to use "PresentModalViewController"

I am trying to display a modal view, but I just can't get it to  
work... No exceptions, just nothing happens...

Any possibility someone can make this a blogging priority? (c;

Adam Langley

Sent from my iPhone
_______________________________________________
MonoTouch mailing list
MonoTouch at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch



More information about the MonoTouch mailing list