Custom NumberPad

Discussion in 'iOS Programming' started by yutamic, May 10, 2009.

  1. yutamic macrumors newbie

    Jan 13, 2009
    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:mad:"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.
  2. kainjow Moderator emeritus


    Jun 15, 2000
    label.text = [label.text stringByAppendingString:@"0"];
  3. yutamic thread starter macrumors newbie

    Jan 13, 2009
    Thank you, kainjow!
    You saved me a lot of time!
    I really appreciate your quick response.

Share This Page