Question

I have a MKMapView with annotations on it and it works fine. I have a search bar as part of my navigation bar. When a user clicks on the search bar field I wanted to bring up a UITableView in code. I create a UITableView in the initialisation and want to add it to the sub view when - (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar; gets called.

This all works fine but im trying to add it using [self.view addSubview:tableView] and nothing shows up. I've only ever made table views using UITableViewController so I'm a bit lost.

Thanks

Was it helpful?

Solution 2

This was actually correct. I was just initialising it wrong not setting the bounds for it.

OTHER TIPS

I'd suggest creating a UITableViewController to control it, and then using presentModalViewController:animated: to show the tableview.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top