Click Tabbar to Open Email view in iphone

Posted by Pugal Devan on Stack Overflow See other posts from Stack Overflow or by Pugal Devan
Published on 2010-03-20T18:15:05Z Indexed on 2010/03/20 18:21 UTC
Read the original article Hit count: 367

Filed under:
|
|
|

HI,

I am new to iphone development.I have created tabbar as programmatically and sets two view in the tabbar. Now i want to load a email application view when i clicked the tabbar and it opened and works properly.Then i clicked the next tabbar and come back to the email view, it doesnot displayed.So i am facing the problem is only one time open my mail application. I want to display the email view while clicked the tabbar. Now i have written in my code is viewDidLoad. So please guide me.

Here is my code,

   - (void)viewDidLoad {

        [super viewDidLoad];

        MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
        mail.mailComposeDelegate = self;
        if ([MFMailComposeViewController canSendMail]) {
        [mail setToRecipients:[NSArray arrayWithObjects:@"[email protected]",nil]];
        [mail setSubject:@"Title"];
        [self presentModalViewController:mail animated:NO];

                     }
        [mail release];

}

Thanks.

© Stack Overflow or respective owner

Related posts about click

Related posts about tabbar