I have a simple iOS 5 storyboard that contains a tableview controller scene. However, the table UI takes up 100% of the real estate and I am unable to add any additional objects such as a title bar. Any object that I drag to the scene will try to size correctly and what-not but as soon as I let go it will not add the object. What am I doing wrong?
I have a simple iOS 5 storyboard that contains a tableview controller scene. However,
Share
If all you want is a title bar, then it looks like you want to embed your table view controller in a navigation controller. You can do this by selecting your table view controller and using the Editor: Embed In: Navigation Controller menu command. Once you do this, you should have a navigation bar, and you can double click it to edit the title.
If you need arbitrary UI elements along with your table view, then I think you need to use a plain UIViewController scene instead of a UITableViewController, and manually drag a UITableView into the scene. Your view controller would not subclass
UITableViewController, instead it would subclassUIViewControllerand implement theUITableViewControllerDelegateandUITableViewControllerDataSourceprotocols. Also, you would need to manually wire up thedelegateanddataSourceoutlets by ctrl-dragging from the table view to your view controller in interface builder, and your view controller would need a customtableViewoutlet that points to the UITableView and is correctly wired up in IB. Perhaps there is a simpler approach than this though, if someone has a better suggestion that would be great to hear.