Search Controller is not showing up in TableView Controller - iphone

I draged and dropped Search Display Controller onto my TableView Controller. When I push that TableView controller from RootView controller, Search Bar is not showing up on the top of the TableView. I used the same technique for the rootview controller and I could see SearchBar on the top of my TableView.
What could possibly cause that problem?

I'm not sure this is the same problem, but I have asked a similar question before, perhaps that can help you.
How do I add an UIView above a TableViewController
Cheers
/Jimmy

Related

Swift How to go Back to previous view controller when bar button tapped

I'm new to Swift programming and here is a really simple question.
How can I go back to previous view controller when a bar button is tapped?
My view controllers are all tableviews, none are navigation controllers. I inserted a bar on top of my table view and added a bar button item and created an action outlet but don't know what code to put inside. I found some responses on stackoverflow that are using a popviewcontrollerAnimated but when I write popviewcontrollerAnimated it says unresolved identifier. I have four viewcontrollers atm, ViewController,SecondViewController,ThirdViewController and FourthViewController.
I'd appreciate any help. Thank you!

XCode: UINavigationItem refuses to show

In a UITableView, I'm trying to add a navigation bar (with title and back button, to be precise). I've already embedded this view in a Navigation Controller, and in all of my other views this just worked out of the box but I can't seem to get the bar to show. I have checked the `Shows Navigation Bar' tick in the navigation controller attributes section in the IB.
What am I doing wrong here? What can I do to get my UINavigationItem to show up?
EDIT: Because some answers in other questions suggested doing this: I've already given it a title which I can also retrieve through NSLog.
Is your parent view controller in a navigation controller ? I would suggest put your parent viewcontroller in navigation controller, do what ever action you to do show UItableViewController and push it on navigationcontroller stack. You will have your UItableView in naviagtioncontroller and there will be back button to parent controller.

Can i add a Navigation Controller to a ModalViewController?

I want to present a Modal view in the middle of the screen in on an iPad. This view will have a search bar and a table view. It will present search results. This is up and running.
Now i need to add a navigation controller so that upon touching a row in the above table view, a detail view will be pushed in from the right to allow the user to determine if this is the item he wanted.
I tried adding a navigation controller to my modal view but it doesn't display and i couldn't find a tutorial for this.
Can someone please give me a hint?
EDIT: I'm starting to think that i first need to push a modal navigation controller and then add the tableview to this, is this the correct approach? Can someone please give some details on this if that's the case?
Yes this is possible. You have to present the NavigationController modal. Your ViewController will be the rootViewController of the UINavigationController.
I posted some code in Adding UINavigationController to existing UIViewController

a view containing UITableView and UITabBar

I am using UINavigationController to push and pop other UIViewControllers in my app.
In one of the UIViewControllers I am using UITabBar to switch between different views. One of the view has UITableView and I am having difficulty showing the tabBar at the bottom. Even if it shows up it scrolls up and down with the tableCells.
I didn't use the tabbarcontroller because apple documentation recommends not to push tabbarcontroller on to navigationcontroller stack.
Thank you.
I guess that you are using UITableViewController. The View of the UITableViewController is the tableView itself, so when you add the tab bar to the view you actually add it to the table view. that is why it scrolls with it.
you should create a regular UIView, and then add the tableView and the tab bar to that view.
shani

Resizing viewControllers view that are part of a UINavigationController on IPhone

I am using a UINavigationController to handle the pushing and poping of viewControllers in my app. Theres a section where i have a tab bar (not using UITabbarController) which is manageed by the same UINavigationController, i simply add the UITabBar to the navigation controllers view (by using addSubview).
The Problem:
I have some UIViewControllers with table views being pushed into the navigation stack, since my Tab Bar is part of the view and not the navigation stack the TableViews are cut off at the buttom because the Navigation Controller does not know of the tab bar because its in its view and n ot the navigation stack. Without a navigation controller i would just resize the ViewControllers view and it would work fine, but when i try to do that it seems like the NavigationCOntroller just ignores my frame and sets its own and therefore the table views are cut off. I found one solution which was to add some extra cells and hide them and that works sort of OK but its kind of hackerish, anyone have any suggestion of how to go about this in a different non -hackerish way?
Thanks
Alright, so i solved the problem. I had tried resizing the UITableView instead of the viewController before, but this did not work. I just realized though, that this did not work because i was using a UITableViewController which manages its own tableView and was not letting me change the frame of it (maybe i was changing it in the wrong place, tried in viewDidLoad, i bet if i did it after the call to [super viewDidload] it would have worked..o well). So I changed the class to a UIViewController and managed the table view in there, now it works good, thanks for the replies.
Try making the root view a UIView with a UITableView for a subview. Then add the UITabBar to the UIView instance. Now the UITableView won't know about the UINavigationController.