PDA

View Full Version : Custom NumberPad




yutamic
May 10, 2009, 11:40 PM
I really need help creating a custom numberpad.
All I want to do is insert a number by pressing different buttons.
For example, if I press "2", then the label shows "2",
but when I press "8" next, then the label will become "28".
It's like a calculator, but my app isn't going to calculate anything.
I just want the label to show the numbers inputed by the user.

By doing the below will only change the label to the number that I pressed, so I want to know how I can continuously keep entering numbers...

- (IBAction)enter0:(id)sender{
[label setText:@"0"];
}

Can anyone give me a hint or point me to the direction where I can look to figure this out?

I would really appreciate for any small help.



kainjow
May 10, 2009, 11:48 PM
Try: label.text = [label.text stringByAppendingString:@"0"];

yutamic
May 11, 2009, 12:17 AM
Thank you, kainjow!
You saved me a lot of time!
I really appreciate your quick response.