我正在打开 web url,UIWebView
其中包含一些带有 java 脚本操作的按钮。点击此按钮后,此页面电子邮件中有一个按钮我得到电子邮件地址和电子邮件正文
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{if( [requestString rangeOfString:@"email.com"].location!=NSNotFound){if ([MFMailComposeViewController canSendMail]){if (!mailer)
mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
NSString *subject = [dataManager.dictTransalations objectForKey:@"71"];
[mailer setSubject:subject];
NSArray *toRecipients = [NSArray arrayWithObjects:distributorEmailAddress.length > 0 ? distributorEmailAddress:@"", nil];
[mailer setToRecipients:toRecipients];
[mailer setMessageBody:@"" isHTML:NO];
isFromMailVC=YES;
//[self presentViewController:mailer animated:YES completion:NULL];
[self presentModalViewController:mailer animated:YES];
}}return NO;}
- (void)mailComposeController(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error{
switch (result)
{
case MFMailComposeResultCancelled:
NSLog(@"Mail cancelled: you cancelled the operation and no email message was queued.");
break;
case MFMailComposeResultSaved:
NSLog(@"Mail saved: you saved the email message in the drafts folder.");
break;
case MFMailComposeResultSent:
NSLog(@"Mail send: the email message is queued in the outbox. It is ready to send.");
break;
case MFMailComposeResultFailed:
NSLog(@"Mail failed: the email message was not saved or queued, possibly due to an error.");
break;
default:
NSLog(@"Mail not sent.");
break;
}
[controller dismissModalViewControllerAnimated:YES];
NSLog(@" Mail Composer Error = %@",error);
}
关闭mailComposeController
UIWebView
java 脚本后,其他按钮不起作用,并且在另一个选项卡中点击另一个包含一些产品列表的 web url 也显示空白和头部图像。
当我在文档目录中看到缓存中的数据时,它在 List 表的 100000.db 中。
我不明白为什么在打开和关闭 mailcompose 后它没有加载。从后台退出应用程序后,它可以工作。
有什么方法可以UIWebView
在 iOS 5.1 中调试页面?