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 580589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:29:20+00:00 2026-05-13T14:29:20+00:00

I have a UITextField for which I get input from some buttons that are

  • 0

I have a UITextField for which I get input from some buttons that are part of the UI (so the input does not come form the phone’s virtual keyboard). I want to limit that number of characters. I tried using the shouldChangeCharactersInRange, but it only works if the input comes form the virtual keyboard, and it doesn’t work if the input comes from the buttons on the UI. Is there anyway I can solve this without programmatically having to count the characters in the text field every time I want to update it?

Thank you,
Mihai Fonoage

  • 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-05-13T14:29:20+00:00Added an answer on May 13, 2026 at 2:29 pm

    Since you are programmatically making changes to the UITextField once the user clicks the relevant buttons on the UI, you should keep track of the number of characters entered using a counter.
    Increase the value of the counter every time a relevant UI button is touched. Update the textfield only if the counter value is <= maximum allowed no. of characters.

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

Sidebar

Related Questions

I have a core data application which uses a navigation controller to drill down
I have a basic view with a UITextField and a Tableview. I am able
I have two text fields in which numbers are inputed as strings. I need
I'm trying to set up a UITableView which acts as a form. Each cell
I have used below code in my application of User Registration to interact with
Right, I'm trying to get a label with text in it (done already obviously),
I have the following ViewController class #import <UIKit/UIKit.h> @interface SampleViewController : UIViewController { IBOutlet
One thing I've learned at engineering school is to always to intense validation of
I am developing In App purchase for one existing application. Scenario is something like

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.