开发者

How to load htm file from URL?

I need to load url in UIWebview in iPhone. But the url is htm format. So, the url doesn't load in UIWebview.

I used the following url, as parsing : http://feeds.epicurious.com/latestfeatures and I get image url as a htm format.

The image URL is http://feedads.g.doubleclick.net/~at/-0LKpwQCz1qAqaaMSvxTK4I9PjA/0/di.

There is a way to load this URL in UIWebview.

Is there another possible way to load that url in UIImageview? If there is a any way, to load UIImageview, it also OK for me.

I used the following code:

UIView* testView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)] autorelease];
UIWebView* testWebView = [[[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)] au开发者_如何学JAVAtorelease];
[testView addSubview:testWebView];
[testWebView setDelegate:self];
[testWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://feedads.g.doubleclick.net/~at/K_fHnmr7a7T0pru2TjQC29TsPYY/1/di"]]];
[self.view addSubview:testView];

My URL page is:

How to load htm file from URL?

How to load htm file from URL?


I don't see a reason why that URL would not load in a UIWebView.

You should be able to use code similar to this:

NSString *url = @"http://feedads.g.doubleclick.net/~at/K_fHnmr7a7T0pru2TjQC29TsPYY/1/di";
[myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜