MWFeedParser应用程序内的Web浏览器Safari的INSTEAD的 [英] MWFeedParser in-app web browser INSTEAD of safari

查看:214
本文介绍了MWFeedParser应用程序内的Web浏览器Safari的INSTEAD的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我使用了MWFeedParser,我认为这是一个美丽的RSS源的应用程序,而是一个链接,当点击它去野生动物园。我担心,iPhone用户的很大一部分是不知道的事实,他们可以在iPhone的唯一键双击可以查看所有打开的应用程序,并返回到RSS提要,从而将卡住。因此,我宁愿使用应用内浏览器。

So i'm using the MWFeedParser, which I think is a beautiful RSS feed app, but when clicking on a link it goes to Safari. I fear that a good portion of iPhone users are unaware of the fact that they can double-click on the iPhone's one and only button to view all open apps and go back to the RSS feed, and will thus get stuck. Therefore I'd rather use an in-app browser.

在换句话说,现在当我点击从MWFeedParser它进入Safari浏览器中的链接;我preFER它关系到应用程序内浏览器。

In other words, currently when I click on a link from MWFeedParser it goes to Safari; I prefer it goes to an in-app browser.

我有浏览器类设置了一个名为WebViewController。
基本上是 [detailWebView的loadRequest:[的NSURLRequest requestWithURL:detailURL];
因此,detailURL就是它会寻找什么

I have the browser class set up called WebViewController. basically with [detailWebView loadRequest:[NSURLRequest requestWithURL:detailURL]]; So "detailURL" is what it will look for

我怎么把在DetailTableViewController而不是sharedApplication code ???

What do I put in the DetailTableViewController instead of the sharedApplication code???

推荐答案

无赖没有人能够回答......万一别人都在寻找如何做到这一点,改变的 didSelectRowAtIndexPath方法的内容

bummer nobody was able to answer...in case others are looking for how to do it, change the contents of didSelectRowAtIndexPath to

if (_webViewController == nil) {
        self.webViewController = [[[WebViewController alloc] initWithNibName:@"WebViewController" bundle:[NSBundle mainBundle]] autorelease];
    }

    MWFeedItem *entry = [parsedItems objectAtIndex:indexPath.row];
    _webViewController.entry = entry;
    [self.navigationController pushViewController:_webViewController animated:YES];


    // Deselect
    [self.tableView deselectRowAtIndexPath:indexPath animated:YES];

添加WebViewController;
该.M有

Add a WebViewController; the .m has

#import "WebViewController.h"
#import "MWFeedItem.h"
@implementation WebViewController
@synthesize webView = _webView;
@synthesize entry = _entry;

// The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.


- (void)viewWillAppear:(BOOL)animated {

    NSURL *url = [NSURL URLWithString:_entry.link];    
    [_webView loadRequest:[NSURLRequest requestWithURL:url]];

}

- (void)viewWillDisappear:(BOOL)animated {

    [_webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]]];

}

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc. that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [_entry release];
    _entry = nil;
    [_webView release];
    _webView = nil;
    [super dealloc];
}

而.H有

@class MWFeedItem;

@interface WebViewController : UIViewController {
    UIWebView *_webView;
    MWFeedItem *_entry;
}

@property (retain) IBOutlet UIWebView *webView;
@property (retain) MWFeedItem *entry;

(基本上,我只是把雷Wenderlich的RSS进纸器的web视图的一部分,在这一个扔了。)

(Basically I just took the webview part of Ray Wenderlich's RSS feeder and threw it in to this one.)

这篇关于MWFeedParser应用程序内的Web浏览器Safari的INSTEAD的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆