I have a variable called “sellPhone”. I want to add it into the URLWithString. What is proper code to do so?
- (IBAction)buttonCall:(id)sender {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *sellPhone = [defaults objectForKey:@"sellPhone"];
[[UIApplication sharedApplication]
openURL:[NSURL URLWithString:@"tel:%",sellPhone]]; //something like this!!!
What is correct way? Thank you!!!
[NSURL URLWithString:[NSString stringWithFormat:@”tel:%@”,sellPhone]]
To return back to app after call ended:
UIWebView *callWebview = [[UIWebView alloc] init];
NSURL *telURL = [NSURL URLWithString:[NSString stringWithFormat:@”tel:%@”,sellPhone];
[callWebview loadRequest:[NSURLRequest requestWithURL:telURL]];