0

I am using search bar example from Search Bar With UITableView. I tried to hide empty table rows using:

self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero]; 

It hides extra rows in normal state of table view with default data. But when I search for something, empty rows show up as well. Why is this happening? How do I fix this? Table View without searching anythingTable View when searching

1 Answer 1

1

The searchDisplayController has its own table view that you can access with self.searchDisplayController.searchResultsTableView. You need to add a footer view to that table view also. Use of a UISearchDisplayController is depreciated in iOS 8; you should be using UISearchController now, unless you need to support iOS 7.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.