Press Tabbar to open the email view in iphone.

Hi

I am new to iphone development. I created a software interface and scored five views in the panel. Now I want to download the email application view when I clicked on the tab. This is working correctly. When I click the next tab and return to the email view, I can see the normal view, not the email view. Only once I can see my mail application. I have a mail application in the viewDidLoad method. 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:@"aaa@gmail.com",nil]];
        [mail setSubject:@"Title"];
        [self presentModalViewController:mail animated:NO];

                     }
        [mail release];

}

Thank.

+3
source share
2 answers

viewDidAppear, . viewWillAppear.

+1

viewDidLoad nib, viewController, .

viewDidAppear:, viewController.

+2

Source: https://habr.com/ru/post/1737831/


All Articles