What the heck am I missing here??? I keep getting
No visible @interface for 'UIApplication' declares the selector 'openUrl:'
#import "ViewController.h"
@interface ViewController ()
@property (strong, readwrite, nonatomic) IBOutlet UIWebView *webView;
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
www.delegate = self;
[www loadRequest:[NSURLRequest
requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
}
- (BOOL) webView:(UIWebView *)webView
shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType
{
if ( navigationType == UIWebViewNavigationTypeLinkClicked ) {
NSLog(@"%@", [[request URL] absoluteString] );
[[UIApplication sharedApplication] openUrl:[[request URL] absoluteString]];
}
return YES;
}
@end