Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UISearchBar Not appearing

I have view controller, into the view i have put a table view, and a search bar into the table's header... the search bar is not showing up, just the empty table view.

Do i need to do something additional? I'm pretty sure its to do with the view outlet of the UIViewController, set to View...

Thanks

like image 354
joec Avatar asked Mar 31 '10 20:03

joec


1 Answers

For anyone else who may be landing on this question, I had a very similar situation where a UITableViewController with a UISearchBar added to it wasn't displaying. If you find yourself in this situation, double check that you are actually calling:

initWithNibName:@"MyNibName" bundle:nil

to init your view controller instead of the common Table View init of:

initWithStyle:UITableViewStylePlain

I was foolishly adding the search bar to the Nib, and then loading it with the style init (which skips the Nib entirely and loads the table view from scratch)

like image 99
Bdebeez Avatar answered Dec 31 '22 18:12

Bdebeez