openURL

UIApplication有个功能十分强大的openURL:方法

- (BOOL)openURL:(NSURL*)url;

//获取应用程序的象征
UIApplication *app = [UIApplication sharedApplication];

//打电话
[app openURL:[NSURL URLWithString:@"tel://10086"]];

//发短信
[app openURL:[NSURL URLWithString:@"sms://10086"]];

//发邮件
[app openURL:[NSURL URLWithString:@"mailto://[email protected]"]];

//打开一个网页资源
[app openURL:[NSURL URLWithString:@"http://xxx"]];

results matching ""

    No results matching ""