views:

118

answers:

1

Hi, i'm new with iPhone developpement and i try to lunch a UIviewController when the user pressed a button witch will allow the user too send an email.

So my AppControler is a NSObject witch contains a UIWindow and a UIViewController* myViewController

When i detect the click on the button i create this:

 MFMailComposeViewController *picker =
 [[MFMailComposeViewController alloc] initWithNibName:@"MainWindow"
 bundle:nil];

  picker.mailComposeDelegate = myViewController;

... set the mail

and then when i try to present the view controller with this

 [myViewController presentModalViewController:picker animated:YES];

 [picker release];

Nothing append..

i know it's simple but i cant figured it out what is wrong.

thanks

A: 

Try using:

[self presentModalViewController:picker animated:YES];

As @dannywartnaby mentioned unless myViewController points to the current view controller (self) it won't work.

chris
the view controller is not self because self is a NSOjects so i can't do a presentModalViewController on selfhow can i check if myViewController points on the good controller?
Maxime