Q:

How to call a phone from a number entered in a UITextField?

I'd like to make a button call a phone number entered by the user inside the text field. I have a code but it doesn't work.
NSString * phoneNumber = [NSString stringWithFormat:@"%@%@", @"tel://", phoneNumber.text];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];

Anyone has a similar approach to this? Thanks.

A:

I think it's tel: instead of tel://.  See this Apple document. Try giving this a shot:  
NSString *pn = [@"tel:" stringByAppendingString:phoneNumber.text];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:pn]];

