How do I have a Tableview go to another tableview - iphone

Right now I have an indexed tableview that goes to a detail view but i want it to go to another tableview then a detail view.
Any thoughts?

Use a UINavigationController with the first table view as its root view controller.
Implement the tableView:didSelectRowAtIndexPath: method of the table view's delegate to create the second table view (from a nib or programmatically, doesn't matter, as long as it's an instance of UITableViewController), then call the navigation controller's pushViewController:animated: method with the new controller.
Then, from the second controller, present your detail view as you are doing so already.
See also:
Using Navigation Controllers
Navigating a Data Hierarchy with Table Views
SimpleDrillDown sample project (may require registration)

The same way you would go to a detail view, but instead of transitioning to a view transition to a TableView.

Related

interact the navigation controller bar button with embed container view

I've created a UIViewController, and insert a container view in it, which embed a UITableViewController. As the image described above.
When user click the Table View Cell, I'd like to add a UIBarButton on the Navigation bar.
But, how can I manage this? I can rise the DatePicker when click on Table View Cell, but when I call self.presentingViewController in table view controller implementation file, it returns (null), same as when I call self.parentViewController
You're probably trying to access the parent controller too early. If you log self.parentViewController in viewDidLoad, it will return null, but it should return the correct controller from viewDidAppear, and certainly from the didSelectRowAtIndexPath method. Using parentViewController in this context is correct, not presentingViewController.
I'd suggest to implement the UITableViewController Delegates and Datasource Methods in the ViewController itself.
That way you don't have to worry about accessing the ViewController containing the UITableView.

iOS 5 Partial Transitioning View Controllers

I am having trouble to find out the best way of transitioning only a part of view controller.
This is what I have:
In my first view controller, I have a UIView that acts like a header where I provide some ImageViews and Labels, bellow it I have a table view.
When user clicks a cell from the table, another view controller is pushed and it contains the same UIView header as before and bellow it some detailed information about the cell item selected.
This is what I want:
Since both view controllers have the same UIView header, I would like it to be fixed and only change the bottom contents (table view or detailed informations). I expect a transitioning effect that only move the contents on the bottom.
I appreciate any guidance.
A View controller controls views, so it isn't a case of transitioning view controllers, you can do this by transitioning views.
You can have multiple views. that occupy portions of the window.
In your case you could keep the top view (the one that you call the header) and when you need to change a part of the view your controller just needs to create a new view to display and then you can animate it into it's new position on top of the old view.
UIView animations let you accomplish this. For example, you could use transitionFromView:toView:duration:options:completion: to animate from your table view to the detail view.
It is possible to have a different view controller for this detail view if you want. All you need to do is create the view controller with the information that is needed to configure its view, and then pass this view as the toView to the above method, and then when you are done with the view, you can use the same method to transition back to the original tableview.

Custom view controller help

I'm a bit confused as to implementing custom view controllers. I have a view that I want to have slide down from the top of the window. The view has three buttons on it. When the button for the view to drop is tapped the view drops. And when tapped again the view slides up/goes away. I have the drop down view saved as a nib file. Would this be the best method for implementation? Or should I have the view in the main view's nib?
And could I get some direction on how I should set it up?
The usual pattern has each of the view's stored in their own XIB file and associated with their own view controller objects. You then alloc/init the new view controller and point it to its XIB and present it modally. Once its presented, its VC responds to its actions and interacts with the model and updates its own views. You can then dismiss that view controller and its views to revert back to the parent view controller.
I have noticed a pattern mentioned in SO where people alloc/init a child VC and then within their present VC they addSubview the newVC.view, but that just seems pretty unusual to me.
If you just have a subview that is being animated down to partially cover the screen, perhaps it doesn't warrant its own VC since, as I think I'm understating your usage, its actions would map to your current VC. In that case, I would either create its contents programmatically or just as another view in the XIB for your first VC and animate that down when needed.

How to create Footer view in the table view Using View Controller in iPhone

I want to create a footer view in my table view.I have created view controller and add a subview as table view. So how can i add the footer view in that table view?.
Note: I have used only view controller, not table view controller.
I haven't used table view controller in my apps, bcoz i have used many controllers as subview in the view controller. Is there any sample programs available? So how can i achieve this?.
Please Help me out.
Thanks.
Make your controller a table view delegate and use viewForFooterInSection method. For details, check UITableViewDelegate Protocol reference.

Add a background image to tables in a navigation view in a tabbed application

I have a tabbed application which then has a navigation controller. In each the navigation controller I an a table View Controller which obviously contains a table. I push a new table view controller from this one.
I want to put a background to the table but can only add an image infront of the table. I think this may be because I am adding the sub view in the table view controller, but I don't seem to be able to add it anywhere else.
Please could you help me, thanks.
Try setting UITableView.backgroundView to say UIImageView of your choice and if that's not helping you too much, try setting the UITableViewCell.backgroundView for each of your cell to something similar. As far as I remember the UITableViewCell is opaque and the UITableView is not necessarily seen under it.
I have used a view controller to add the uiimage view then the table view controller view too. This gets the desired visual result, but the table is no longer in the navigation stack so when you clikc on the cell it doesn't push the nav controller.
Is there a way to talk between the table view controller and its view controller?