PDA

View Full Version : Launch Safari from UIWebview




NYG71
Apr 30, 2009, 11:29 AM
Hi All,

Newbie here...

I have a simple app built with a UIWebview. Upon start of my app, the UIWebview brings in the content from my website. When I click on a link within it, it then navigates to that particular site. This is not what I want.:confused:

I'd like to come up with a method where upon clicking/tapping the link within the UIWebview that you will get the following:

--REQUIRED FEATURE--
1. Close the app and open the URL in safari.

--OPTIONAL FEATURE--
2. A message stating that you are about to close the app and navigate to the URL.

Here is what I have up to this point. If you could please tell me exactly where I need to make modifications and to what file such as MainView.h or .m and etc.

-----------MainView.m-------------

#import "MainView.h"

@implementation MainView

-(void)awakeFromNib {
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.NYG71.com"]]];
}

@end
Like I said, I'm a newbie so the only programming experience I have is shell scripting. It'll take me awhile to get used to Objc and Cocoa.

Any help would be awesome.:)