Storyboard - insert a Searchbar and linked it to the containerview (tableviewcontroller) - objective-c

I had a tableviewcontroller with a SearchController I managed programmatically. For some reasons, I need to have a storyboard to display things a bit differently not anymore a tabéeview in full screen.
Everything is going fine with a container view inside my storyboard. The container view is linked to my custom tableviewcontroller which was managing my searchbar. When I instantiate an object, I can see my custom tableView (with a searchbar lying at the top) in the same way it was before.
I would like to remove the search bar embeded to my tableview (i.e in my tableviewcontroller) and add it directly in the storyboard (to have more at the top of my screen with free space between the search bar and the table view. I tried to insert a searchbar and displaycontroller but I am stuck in the sense I cannot link the searchBar to my tableViewController.
How can I do to link the searchbar in the UIViewController to the tableviewcontroller in the containerview? My tableviewcontroller conforms to the protocol necessary to have a searchbar working still there was no problem when they were not gathered inside a storyboard.
Here is an image if it can help.
If anyone could help me to link the searchbar and the tableviewcontroller...
Thanks!

Related

Dissociate Searchbar from TableView in UIViewcontroller

I try to separate a tableview from its searchbar. Is it possible to add a Searchbar in a UIView (xib file / storyboard) at one place of a viewcontroller, then add a containerview targeting a tableview at an other place of the UIView and then linking both to have them working together as if we had added the searchbar directly a tableviewcontroller?
I need to have some space between my searchbar and my first row of the tableview to insert labels that have to stay in place without being thrown away when scrolling down...
The searchbar is working properly when inserted directly inside the tableviewcontroller. Ideally I just would like to insert a new object (the searchbar) and connecting it (delegate,...) to the tableviewcontroller inside the containerview.
Is it possible? Something like the image below...
Thanks!

Add other objects to iOS 5 storyboard after tableview

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?
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 subclass UIViewController and implement the UITableViewControllerDelegate and UITableViewControllerDataSource protocols. Also, you would need to manually wire up the delegate and dataSource outlets by ctrl-dragging from the table view to your view controller in interface builder, and your view controller would need a custom tableView outlet 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.

Creating a split view application similar to 'settings' app

I am trying to build an iPad app set-up as a split-view, but on the detail page being able to drill down like a navigation controller.
An example of this working is the setting app on the iPad where if you select the 'General' tab you can then drill down on the detail page from say general > network > VPN
Any help or tips on this would be great. I thought it might be two navigation controllers on the root nib, but couldn't get this working.
you mean like General -> About ->.. (in ipad simulator) right .
if all your detail view needs the TableView, then its better to make your detailviewcontroller as the subclass of UITableViewCOntroller.
OR If you need different views when click on the cells of rootcontroller(left pane)
Create a method in DetailViewController say setDetailView{}. And call this method when click on the cell of RootController
inside this method,
remove all subviews from detailview
create UITableView and set its delegates
on tableview didSelect method, we can push other UIViewController instance
[self.navigationController push...]
Hope it helps.

Why isn't my tableview visible?

I'm an sdk newbie, so please forgive the simplicity of this question. Here's the scenario:
I used the Utility Based application template because I like the flip effect of the info button. I changed the info button to a round rect button and made a copy of it that to have two round rect buttons on my first view. I modified the flipside view to display a picture and that functionality works fine. For the second button I wanted it to flip to a tableview underneath the navigation bar. I added a navViewController for the navigation bar and a TableViewController for the tableview. I made a nib for that View, added the tableview, hooked up all the appropriate connections, but when I run it, the flip works fine, but there is no tableview displayed. What I mean by no tableview is it is blank. No lines or anything, just a blank navigation bar at top and blank white space. Please help! Thanks!
With limited information you have given here:
Potential Problem 1 - First Level UIViewController is not linked
If you open NIB file in interface builder where you have drag and dropped NavigationViewController, you will see small disclosure triangle. If you expand that you will see NavigationBar and UIViewController. Select the UIViewController and change it to name of the TableViewController.
The NIB file will change and say View Loaded from YourTableViewController.
Potential Problem 2 - You have to do addSubView or insertSubView and pass in [navigationController view]
If you post some code it may be helpful.
Hope this Helps!

UISearchBar and UINavigationController

I have an .xib file connected to a ViewController, which is init'ed as the root controller of an instance of UINavigationController in my appDelegate.
In that view, I have a UISearchBar and a UITableView below it.
When the view loads up, there's a navigationBar at the top, followed by a ~20 pixel gap, and then the UISearchBar, and the table beneath it:
My problem is that when I enter the UISearchBar to type something, the navigation bar disappears (which is fine), but the search box is all screwy:
I'm pretty new to this (a couple of weeks), so I'm not quite sure what's going on. Can anyone help me shed some light on this?
Did you pull the search bar into the parent view or into the table view? The search bar should be the header view for the table, and not as a standalone view. If you want it to be standalone anyway, make sure your autoresizing flags are correct (under cmd-3 (size) in the inspector in Interface Builder); the search bar should stick to the top and not be flexible in height.