您的位置:首页 > 其它

百度uri 跳转

2015-07-31 16:52 246 查看
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{

//1。获取应用程序对象
UIApplication *app = [UIApplication sharedApplication];
//2.获取url
NSString *str = [NSString stringWithFormat:@"baidumap://map/geocoder?location=39.990912172420714,116.32715863448607&coord_type=gcj02&src=cn.beidou.ios"];
NSURL *url = [NSURL URLWithString:str];
//3.看是否能打开
if ([app openURL:url])
{
//3.1能打开
[app openURL:url];

}
else
{
//3.2打不开 去appstore下载
NSLog(@"cannot open url go fuck youself!");
}}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: