`
wang_peng1
  • 浏览: 3902778 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

打开url判断

 
阅读更多


- (BOOL)callPhoneNumberWithString:(NSString *)phoneNumberString {
    NSURL *url = [NSURL URLWithString:phoneNumberString];
    if ([[UIApplication sharedApplication] canOpenURL:url]) {
        [[UIApplication sharedApplication] openURL:url];
        return YES;
    }
    return NO;
}

- (IBAction)callFirst:(id)sender {
    [self callPhoneNumberWithString:@"tel:0123456789"]; 
}

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics