Reputation: 563
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.
Upvotes: 0
Views: 5136
Reputation: 289
-(IBAction)numberButtonPressed:(UIButton *)pressedButton
{
self.phoneNumberLabel.text = [self.phoneNumberLabel.text stringByAppendingString: pressedButton.titleLabel.text];
}
You can take a look at turorial here:
http://mobile.tutsplus.com/tutorials/iphone/design-build-a-1980s-ios-phone-app-making-phone-calls/
Upvotes: 2