我有一个现有的应用程序,当前有嵌入的帮助文件;我正在尝试更改它们,以便他们访问互联网以获得本地化的帮助文件。这是我的代码:为什么此代码不显示Google.com
// make the popover
UIViewController* popoverContent = [UIViewController new];
UIView* popoverView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 450, 500)];
popoverView.backgroundColor = [UIColor colorWithWhite:(CGFloat)1.0 alpha:(CGFloat)1.0]; // frame color?
popoverContent.view = popoverView;
//resize the popover view shown in the current view to the view's size
popoverContent.preferredContentSize = CGSizeMake(450, 500);
NSURL *indexURL = [NSURL URLWithString:@"google.com"];
// add the UIWebView for RichText
webView = [[UIWebView alloc] initWithFrame:popoverView.frame];
webView.backgroundColor = [UIColor whiteColor]; // change background color here
// add the webView to the popover
[webView loadRequest:[NSURLRequest requestWithURL:indexURL]]; // load it...
[popoverView addSubview:webView];
// if previous popoverController is still visible... dismiss it
if ([popoverController isPopoverVisible]) {
[popoverController dismissPopoverAnimated:YES];
}
//create a popover controller to display the HELP text
popoverController = [[UIPopoverController alloc] initWithContentViewController:popoverContent];
[popoverController presentPopoverFromRect:((UIButton *)boHelpGeneralSetup).frame inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
此代码在嵌入帮助文件时起作用;为什么当我尝试从互联网上的网页获取文件时,它不工作?
当该文件嵌入? – lluisgh
包含网页上* exact *语言的HTML文件。这与问题无关。 – SpokaneDude
尝试使用http:// –