Добавьте MFMailComposeViewControllerDelegate
к вашему интерфейсу контроллера представления.
затем сделайте текущий контроллер представления делегатом при инициализации ``
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
, вы будете уведомленыстатус почты в методе
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
// Notifies users about errors associated with the interface
switch (result)
{
case MFMailComposeResultCancelled:
// message.text = @"Result: canceled";
break;
case MFMailComposeResultSaved:
break;
case MFMailComposeResultSent:
break;
case MFMailComposeResultFailed:
{
UIAlertView *FailedAlert= [[UIAlertView alloc]initWithTitle:@"Mail could not be sent" message:nil delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil, nil];
[FailedAlert show];
[FailedAlert release];
break;
}
default:
NSLog(@"Hit default case in the switch");
break;
}
[self dismissModalViewControllerAnimated:YES];
}
Здесь вы сможете загрузить новое представление на основе вашего выбора и результата.