天天看点

iOS 跳转到浏览器打开网页

1.在ViewController中添加button action

2.

- (IBAction)url:(id)sender {

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.baidu.com"]];                         

}

3.测试通过