打开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"]; }

 

你可能感兴趣的:(url)