views:

2225

answers:

3

Hi all..

I have made an app with a Tabbar and an RSS reader in one window. I know how to open the RSS links in the build in safari browser, but how do I open the links in a UIWebView in the same tab instead? I don't want to quit my app to view the webpage, and how do I go back to the RSS view? Simply by hiding the webview?

Hope you can help. Thanks..

+3  A: 

Use the UIWebViewDelegate method:

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

In that, intercept the link, and load however you like.

August
+1  A: 

I think what you need is Navigation setup.

You should have a Navigation Controller that has your RSS reader as it's root view controller. Then whenever a user selects a story in your RSS feed, create an instance of a new view controller that has a WebView as it's view. You can then pass the URL to the new web view and 'push' the webview onto your navigation stack.

All you have to do then is tell the webview to load the URL you passed it, and it'll do its thing.

Then when the user is done, all they have to do is hit the back button that gets created for you by the Navigation controller.

Jasarien
A: 

Can you please show me how to do so or can you give me the whole code to do this step by step. i got the rss to work and show in the table view, but i dont want it to leave my application to open the link, but rather just have it push off into a webview. HELP

Oliver