I am creating a dialpad application in Xcode (which is very similar to the iPhone Phone app) and everything is working but the buttons linking up to the label.
What would be the code to add a certain number onto the end of other numbers on a label (if that makes sense!)? The number would be based on what title the label has (so that it will automatically work out if the button is number 6 or number 2 etc...).
The label which I need the numbers in is called phoneNumberLabel.
Here's the code I'm using (which won't work);
-(void)displayPhoneNumber
{
self.phoneNumberLabel.text = self.phoneNumberString;
NSLog(@"Displayed Phone Number");
}
-(IBAction)numberButtonPressed:(UIButton *)pressedButton
{
int toneIndex = [pressedButton.titleLabel.text intValue];
SystemSoundID toneSSID = toneSSIDs[toneIndex];
AudioServicesPlaySystemSound(toneSSID);
self.phoneNumberString = [self.phoneNumberString stringByAppendingString:pressedButton.titleLabel.text];
[self displayPhoneNumber];
NSLog(@"Number Pressed");
}