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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:07:40+00:00 2026-05-17T19:07:40+00:00

Normally we use the resignFirstResponder to hide the keyboard in the iphone apps. For

  • 0

Normally we use the resignFirstResponder to hide the keyboard in the iphone apps.
For example, when we use a UISearchBar, after the user click the search button, we hide the keyboard by implement the searchBarSearchButtonClicked function like this:

 -(void)searchBarSearchButtonClicked:(UISearchBar*)searchBar{   
        NSLog(@"Search Button Click, result should be show here"); 
        [searchBar setShowsCancelButton:NO animated:YES];
       [searchBar resignFirstResponder];    
        self.dictTableView.allowsSelection = YES;   
        self.dictTableView.scrollEnabled = YES;     
}

We set the searchBar as the first responder, then the keyboard will be hidden after the user click the search button.

Why it works like this? We didn’t call any function that hide the keyboard, we just set the searchBar as the first responder, why the system just hide the keyboard automatically?

Could anyone explain the mechanism of this process?

Thank you very much!

  • 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-17T19:07:40+00:00Added an answer on May 17, 2026 at 7:07 pm

    Objective-C works by sending messages to objects in the form of selectors which are names of methods belonging to the targeted object. A “responder” is an object that will respond to a message sent in by a UI event.

    Responders live in an hierarchy called the responder chain. If a responder cannot understand a UI message it forwards it to the next responder in the chain all the way up to the application object itself.

    In the case of a text field, tapping the field causes the field to become the first responder such that it intercepts all subsequent UI events. A text field traps UI events with the keyboard so it automatically evokes the keyboard. A text field has no interest in any input not associated with the keyboard so when it resigns as first responder, it puts the keyboard away.

    This is the beauty of a highly-object oriented API. You don’t have to micromanage standard behaviors. The objects themselves handle it for you. If your used to working with a more procedural API it might be a little disorienting.

    (As an aside, this is old hat these days but it was fan-fricken-tastic back in the early 90s when Objective-C and NextStep were ground breaking technologies. Tim Burners-Lee invented the web browser just so he would have an excuse to buy a Next cube.)

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

Sidebar

Related Questions

I would normally use Google analytics because it is free and simple to implement
I normally use UIViews to make my apps - but this one I am
I normally use gVim for editing, but I sometimes use vim when remotely connecting
I normally use the following code in SQL Server: IF EXISTS (SELECT * FROM
I normally use a dirty method to get my Facebook Graph API token key
keep in mind I normally use pure as3 and FlashDevelop :) I am really
I have this code that where I would normally use one line: if (tableView
I have identified the query constructs my users normally use. Would it make sense
I am encountering a very strange error with my project. I normally use the
I want to detect when my touchpad is clicked! I normally use a usb

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.