0

I want to open RSS Feed in my UIWebView, but it isn't working and opening Safari. My code:

NSString *link = [[NSString alloc] initWithFormat:@"feed://smartfiction.disqus.com/%@/latest.rss", slug];
    NSURL *url = [NSURL URLWithString:link];
    NSURLRequest *requestWeb = [NSURLRequest requestWithURL:url];
    [webViewComment loadRequest:requestWeb];

I found right way. I have created rss parser and showed feed in UITableView. It's more beautiful and easy.

1 Answer 1

1

feed:// is a URL Scheme which is handled by Safari and so will only be opened by Safari... you could try :

 NSString *link = [[NSString alloc] initWithFormat:@"feed://smartfiction.disqus.com/%@/latest.rss", slug];
NSURL *url = [NSURL URLWithString:link];
NSData *rssData = [NSData dataWithContentsOfURL:url];
[webViewComment loadData:rssData MIMEtype:@"application/rss+xml" textEncodingName:@"utf-8" baseURL:nil];
3
  • can you use the webview delegates to find out why it is not working? what is the error? have you double checked the link string to see it is getting filled with slug right? Oct 9, 2011 at 5:31
  • I found another way to make it.
    – werbary
    Oct 9, 2011 at 6:18
  • Feel free create an answer to your question so others can benefit. Oct 9, 2011 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.