iOS开发 openURL方法的使用

openURL方法常用有

1:打开网页:

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

2:给XXX号码打电话:

[[UIApplication sharedApplication]openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:XXX"]]];

3:给XXX号码发信息:

[[UIApplication sharedApplication]openURL:[NSURL URLWithString:[NSString stringWithFormat:@"sms:XXX"]]];

3:打开其他app:

[[UIApplication sharedApplication]openURL:[NSURL URLWithString:[NSString stringWithFormat:@"taobao:参数"]]];

你可能感兴趣的:(iOS开发 openURL方法的使用)