【发布时间】:2015-12-02 18:42:05
【问题描述】:
我想修改我的代码以便在 Safari 上打开外部链接,而不是在我的应用程序的应用程序内浏览器上打开。 html 文件是从内部路径加载的,所以我不知道如何让应用了解所有外部链接都必须在 safari 中打开。
这是我的 ViewController.m
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSString *fullURL = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"];
NSURL *url = [NSURL fileURLWithPath:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[_viewWeb loadRequest:requestObj];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
我应该如何修改它? 谢谢!
【问题讨论】: