开发者

how to show rss feed url in UIWebView in iphone sdk?

I am trying to display url in UIWebView but I ca开发者_高级运维n not display, webview just call the fail with error method. My url is this "http://www.tekniknoktamarket.com/index.php?route=feed/google_base",

So please help me how to display this url in UIWebView *?*


In order to have a UIWebView download and display the content from a URL, you need to go through a couple of layers of abstraction, the first being an instance of NSURL, which contains your URL string. Then, you hand the NSURL to an instance of NSURLRequest. Finally, you hand the NSURLRequest to the webView. It all looks something like this:

NSURL *url = [NSURL URLWithString:@"www.your-url.com"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[yourWebView loadRequest:request];

That should do it.


This is the code loading a URL into a webview:

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.theurl.com"]]];

If you're using this code and are encountering any problems, please provide the code you were using and the exact error

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜