вот как выглядит моя электронная форма:
если ([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init]; mail.mailComposeDelegate = self; [mail setSubject:@"Hello and welcome!"]; NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"]; [mail setToRecipients:toRecipients]; [mail setCcRecipients:toRecipients]; NSString *emailBody = @"Hey all!"; [mail setMessageBody:emailBody isHTML:NO]; mail.modalPresentationStyle = UIModalPresentationPageSheet; [self presentViewController:mail animated:YES completion:nil]; } else { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error!" message:@"E-mail is not supported on your device" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; }
Электронные письма отправляются нормально, но проблема в том, что как только я нажимаю кнопку отправки, электронное письмо отправляется, но контроллер просмотра (или всплывающее окно) не закрывается. Так же не работает кнопка закрытия. Я просто не могу выйти из электронной формы.
Любые идеи?
MFMailComposeViewControllerи протокол делегата. Он охватывает это. - person rmaddy   schedule 23.11.2013