-(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の向きを無効にできますか?