

//從textFieldf取得號碼
NSString *tel = textField.text;
//重新格式化tel為UTF8
tel = [tel stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
NSString *urlString = [NSString stringWithFormat: @"tel://%@", tel];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];
沒有留言:
張貼留言