Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8548901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:36:19+00:00 2026-06-11T13:36:19+00:00

I have an IPad apllication in which I need to make a number pad

  • 0

I have an IPad apllication in which I need to make a number pad type keyboard in my view. With a textfield and 9 numbers.and a back press button. I had achieved this with 9 buttons and a text field.In each of the button action I am appending that digit to the text field value like this:

[number setText:[number.text stringByAppendingString:@"9"]];

Now I need to change the background of the button when textfield.length equall to 9. Otherwise the same. For that i include a check in my each button actions like this.

if ([number.text length]==9)
{
    [button setBackgroundImage:[UIImage imageNamed:@"active.png"] forState:UIControlStateNormal];
}
else 
{
    [button setBackgroundImage:[UIImage imageNamed:@"inactive.png"] forState:UIControlStateNormal];
}

before upending the next i am checking this.but it is changing the background at 9 digits only if include [number.text length]==8.and in the back trace button i am removing the last appended digit by

if ( [number.text length] > 0)
{
    number.text = [number.text substringToIndex:[number.text length] - 1];
}

Here I am checking the digits after the operation.then it is taking the correct length.

can any body help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:36:19+00:00Added an answer on June 11, 2026 at 1:36 pm
    -(IBAction)yourAddNewCharacterMethod:(id)sender
    {
        if([number.text length] < 9)
        {
            [number setText:[number.text stringByAppendingString:@"9"]];
            if([number.text length] == 9)
            {
                [button setBackgroundImage:[UIImage imageNamed:@"active.png"] forState:UIControlStateNormal];
            }
            else
            {
                [button setBackgroundImage:[UIImage imageNamed:@"inactive.png"] forState:UIControlStateNormal];
            }
        }
    }
    

    You will have to check same on each button click.
    And this is your deleteButtonClickedMethod

    -(void)deleteButtonClickedMethod
     {
         if([number.text length] > 0)
         {
            [number deleteBackward];
         }
     }
    

    No need to use substringToIndex:.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Flex application (SDK 4.5.1) which runs on iPad... I need to
I have an iPad application which has many categorized images I need to switch
I have an IPad application in which i am adding a calc type keypad,with
The Problem I have a UIWebView inside my iPad application which I need to
I have an iPad application which connects to a web server. I need to
I have an application which I need to test on an iPad device, however
I have created an IPAD application which supports on Portrait orientation. Before uploading on
I have an existing iPad application to which I've just added core data versioning.
I have an iPad application which requires me to stream a video to a
I have an nascent iPad application, which stores documents internally on the device in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.