1
NSString *urlAddress;
urlAddress = @"http://ob.carptown.net";
NSURL *url =[NSURL URLWithString:urlAddress];

NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[page loadRequest:requestObj];
[page addSubview:activityView];
timer = [NSTimer scheduledTimerWithTimeInterval:(1.0/2.0)
                                         target:self 
                                       selector:@selector(loading)
                                       userInfo:nil repeats:YES];
goBack.enabled = page.canGoBack;
goNext.enabled = page.canGoForward;

UIViewView无法打开上述 URL ( http://ob.carptown.net )
我已经测试了另一个 URL 并UIViewView打开了它们。但是 URL 可以在 Safari 中打开。我希望 URL 打开 safari,并且我想像 safari 一样控制 safari UIWebView

我该怎么做?

4

2 回答 2

0

如果您检查返回的 HTML,服务器会给您一个空<body>标签(谷歌分析除外)。看起来您在页面加载后有 javascript 呈现内容。UIWebView似乎无法执行此操作。只有当从横向和向后改变方向(Cmd + left arrowCmd + right彼此快速地箭头)时,它才会重新加载页面。不幸的是,我不知道为什么会这样

于 2013-06-19T09:13:09.303 回答
0
NSString *urlAddress = @"http://ob.carptown.net";

//Create a URL object.
NSURL *url = [NSURL URLWithString:urlAddress];

//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

//Load the request in the UIWebView.
[yourwebview loadRequest:requestObj];

remove NStimer and check it again it will work fine
于 2013-06-19T08:17:59.607 回答