[MonoTouch] How to use "PresentModalViewController"

Brent Schooley schooleybrent at gmail.com
Mon Oct 5 13:54:34 EDT 2009


Without seeing your code, my guess is there's a problem in whatever
controller you are displaying modally.  The call to
PresetModalViewController is very simple and I can confirm that it works
(just wrote an app yesterday that uses it).  Poke around your modal view
controller for null references, etc.

Brent

On Mon, Oct 5, 2009 at 1:51 PM, Adam Langley <alangley at winscribe.com> wrote:

> Hi Kevin,
>
> So are you saying that the call to "PresentModalViewController" is non-
> blocking?
> Because your code looks very similar to mine... The difference being
> that mine doesn't work...
> I don't have any call to dispose, or dismiss, so I don't _think_ it's
> getting destroyed... I'll have another tinker today
>
> Btw ...  Nice to see the .co.nz represented here (c:
>
> On 5/10/2009, at 11:00 PM, "Kevin Daly" <kevindaly at xtra.co.nz> wrote:
>
> > 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
> >
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monotouch/attachments/20091005/f3b38c97/attachment.html 


More information about the MonoTouch mailing list