Search code examples
uitableviewxcode4.3uisearchbarmaster-detail

UISearchBar in a TableViewController - Master/Detail Application Ipad


I am using a master/detail application and i want to add a searchBar on top of the Master View.
Now as it's known in these kind of applications, the Master View is actually a TableViewController so if i add a search bar on top, and while scrolling, the search bar will automatically disappear. Since it's not a regular table view inside a viewController, i can't simply detach the search bar from the tableViewController. I tried so many ways to try and find the solution but nothing worked.
In short, how can i keep the search bar fix on top of the tableViewController in a Master/Detail Application.
Any help will be highly appreciated.


Solution

  • The solution in this situation was... After creating a view and putting in it the tableView and a search bar, in the MasterViewController.h , instead of calling upon a UITableViewController, i should have called on a UIViewController... In this way no more crashes and everything will turn out great. Hope it helps someone in the future.