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

  • Home
  • SEARCH
  • 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 7196885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:51:49+00:00 2026-05-28T20:51:49+00:00

I have an extended UITextField (added a NSString property, inputType to it) to take

  • 0

I have an extended UITextField (added a NSString property, inputType to it) to take in user input. when the user tap’s the text field, i use a picker for the user to select the input. i also need to allow the user to clear the text box so i thought i could use

tillageTextField.clearButtonMode = UITextFieldViewModeAlways;

to clear the text field.

the issue is when you tap the X to clear the text box, it also fires my picker. i use:

-(BOOL) textFieldShouldBeginEditing:(MyTextField *) textField 
{
    //other code
    else if ([textField.inputType isEqualToString:@"tillageMethod"])
    {
        self.customArray = [NSArray arrayWithObjects:@"No Till", @"Strip Till", @"Full Till", nil];
        self.tempTextField = textField;
        [self showPicker];

        return  NO;
    }
    //other code
}

to show the picker.

is there a way for me to tell if the user tapped the clear button and not show the picker?

  • 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-28T20:51:50+00:00Added an answer on May 28, 2026 at 8:51 pm

    You could also implement textFieldShouldClear: and set a flag on your class (e.g. doNotShowPickerOnNextCallback)

    - (BOOL)textFieldShouldClear:(UITextField *)textField {
    
        if ([textField.inputType isEqualToString:@"tillageMethod"]) {
    
            if (![self pickerIsShowing]) {
                self.doNotShowPickerOnNextCallback = YES;
            }
        }
    
        return YES;
    }
    
    - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
    
        //other code
        else if ([textField.inputType isEqualToString:@"tillageMethod"]) {
    
            if (self.doNotShowPickerOnNextCallback) {
    
                self.doNotShowPickerOnNextCallback = NO;
                return NO;
            }
    
            self.customArray = [NSArray arrayWithObjects:@"No Till", @"Strip Till", @"Full Till", nil];
            self.tempTextField = textField;
            [self showPicker];
    
            return  NO;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have extended a MaskedTextBox component to add some functionality. The text property of
I have extended User via AUTH_PROFILE_MODULE to include a ManyToMany field to Projects the
I have Message class which I have extended and added new property. class ChildMessage:
I have extended a server control (not a user control) and put the code
I have a FBA website and then I extended it (to use Windows Authentication)
I have extended org.eclipse.ui.editors.text.TextEditor to implement a custom editor. For this editor, I have
I have extended Django's User Model using a custom user profile called UserExtension .
I have extended the standard FileSystemWatcher class by adding a string property (fileToTest), now
I have extended an Entity Framework 4 entity class with a calculated property in
I have extended regexes enabled in my Bash by shopt -s extglob They may

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.