-(void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
NSString *eventResult = nil;
[self dismissModalViewControllerAnimated:YES];
switch (result) {
case MFMailComposeResultSent:
eventResult = @"Mail Sent Succesfully";
break;
case MFMailComposeResultSaved:
eventResult = @"Saved into draft";
break;
case MFMailComposeResultCancelled:
eventResult = @"Mail Canceled";
break;
case MFMailComposeResultFailed:
NSLog(@"Mail Fail:%@",[error localizedDescription]);
eventResult = @"Mail failed";
break;
}
//alert for show status of mail
UIAlertView *mailStatusAlert = [[UIAlertView alloc]initWithTitle:@"Email Alert" message:eventResult delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Ok", nil];
[mailStatusAlert show];
[mailStatusAlert release]
我使用上面的代码来处理邮件状态,当 wifi 开启时它工作正常,但如果 wifi 关闭,错误不会像失败一样显示。但我需要那张支票。还有其他方法可以处理该错误吗?我可以禁用横向的mailcomposeviewcontroller 方向吗,因为我的应用程序只支持纵向。