我在這裏丟失了什麼?我不斷收到'UIApplication'沒有可見的@interface聲明選擇器'openUrl:'
爲「UIApplication的」不可見@interface聲明選擇「的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
耐心,蚱蜢。 – matt