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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:37:35+00:00 2026-06-16T13:37:35+00:00

I have the UISearchDisplayController page view as follows (original state) After clicking on the

  • 0

I have the UISearchDisplayController page view as follows (original state)

enter image description here

After clicking on the searchbar and typing some search term, I get a list of results in the table

enter image description here

After clicking on an entry in the table, a new viewController is displayed on top of the stack

enter image description here

My intention is that on the click of the cancel button (on top left), the root view will display the original state of the searchDisplay controller

enter image description here

This is what I have tried

In my cancel method (triggered when I click on the top left hand cancel button)

- (void)cancel
{
  [self dismissViewControllerAnimated:YES completion:NULL];
  [self searchBarCancelButtonClicked:self.searchDisplayController.searchBar];
}

And in the searchbar delegate method I did this

- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
    self.searchBar.showsCancelButton = NO;

    [self.searchBar resignFirstResponder];
    self.searchBar.text = @"";
    searchDisplayController.searchResultsTableView.hidden = YES;
    [self searchDisplayControllerWillEndSearch:self.searchDisplayController];
}

All I manage to achieve after clicking on the cancel button is this

enter image description here

The original tableview seems to be missing (appears only if I click on the page)

How can I modify my methods to revert the search to its’ original state?

  • 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-16T13:37:39+00:00Added an answer on June 16, 2026 at 1:37 pm

    Try [searchDisplayController setActive:NO animated:NO]

    This should hide the search table.

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

Sidebar

Related Questions

I have a UISearchDisplayController that displays some cells after a user has searched. After
I have implemented a UISearchDisplayController that allows users to search a table. Currently the
I have implemented a SearchBar using a UISearchDisplayController and a UITableView to display the
I have set up a search bar for my table view, and I would
In my iphone app i have a search screen with UISearchDisplaycontroller uisng this against
I have implemented a UISearchDisplayController in the UITableViewController. The search is working, but the
I have a non-tableview view with a searchbar in it, and while it works
I have a IUSearchBar with an UISearchDisplayController, and everything is working well: When I
I have a UISearchBar which I am putting in UISearchDisplayController. Now, whenever I tap
Im new to objC and Im currently experimenting on UISearchDisplayController. Basically I have an

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.