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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:28:05+00:00 2026-06-06T18:28:05+00:00

In my app I have a view that is a form that has quite

  • 0

In my app I have a view that is a form that has quite a few inputs.
When the UITextField calls textFieldDidBeginEditing, it checks the tag and will bring up a UIPopoverController or the keyboard depending on the what the input is meant to be.

If the keyboard is up, I need it disappear when the user presses a textfield that brings up the popover. However I cannot make it disappear, I have tried every way to get rid of the keyboard but it just stays there. I have tried:

  • calling resignFirstResponder in textFieldDidEndEditing
  • calling [self.view endEditing:YES] in textFieldDidEndEditing
  • calling resignFirstResponder AND [self.view endEditing:YES] in textFieldDidBeginEditing checking for the previous tag is equal to a keyboard input text field.

Any ideas would be great.

I have ripped it out and and put it in a example project if anyone wants to see the exact behaviour.
http://dl.dropbox.com/u/61692457/KB_Test.zip

  • 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-06T18:28:07+00:00Added an answer on June 6, 2026 at 6:28 pm

    Declare a Global UITextField in .h file

    UITextField *txtfld;

    Replace Your method textFieldDidBeginEditing with textFieldShouldBeginEditing and now write this code

    - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField 
    {
    
    if (textField.tag == 1 || textField.tag==3)
    {
    
        if(numPickerPopover == nil)
        {   
    
            numPicker = [[[NumPicker alloc] initWithStyle:UITableViewStylePlain] autorelease];
    
            numPicker.delegate = self;
    
            numPickerPopover = [[UIPopoverController alloc] initWithContentViewController:numPicker];
            [numPickerPopover setPopoverContentSize:CGSizeMake(60.0, 260.0f)];
        }
    
        [numPickerPopover presentPopoverFromRect:textField.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    
        [txtfld resignFirstResponder];
        return NO;
    }
    
    
    if (textField.tag == 2)
    
    {
    
        txtfld = textField;
    
        return YES;
    }
    
    return YES;    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iPhone app that shows a simple view (View 1) that has
I have an app that has a centre view with two views off to
i have an asp.net mvc app that has a form that uploads a file.
I have a small app in codeigniter. There is a form that has 3
I have an iPhone app with a main view that has a UILabel and
I have a view controller based app that contains several views that I display/hide
I have an app that have several views. In one view I would like
I have an app that presents Table View of different files. I have it
I have an app that I just got setup with a split view controller
I have an app that needs backgrounds for both parts of the split view.

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.