Search code examples
iosbuttontextfieldphone-call

Get phone number in textfield to make a phone call when pressing a button


The application simply wants to make a user input a phone number in a text field and then when a button is tapped, it'll call that number. What's the best code for this? I have already created a button and a textfield in my nib file.

I'm using Xcode 4.


Solution

  • Here shows you how to do it. Just make the NSMutableString phone go to your text field (by using yourTextField.text)