I want to know esque I can do when I click Finish"-(IBAction)textFieldDoneEditing:(id) sender " on the keyboard, I view a tableView
You can create a view controller which contains the table view and populate it when the user finishes editing and then show the view controller's view as subview if you want it on the same view controller or you can also push it in the navigation stack if you have one.
Related
I have a login view controller at the start of the app. Then once the user login is successful I am taking the user to a view which has a table view inside it. I have embedded the table view inside a navigation controller. I have a segue which pushes user to the detail view. However as soon as I click on the row cell, I get the following error.
'Could not find a navigation controller for segue 'Event Details'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.''
But as I said above, there is a navigationview controller which embeds the table view. Whats causing this error?
the flow of the app is as follows
'->Login View NavigatinViewController->(View with a table View inside)->Details'
That looks like you may be missing a view controller.
Specifically, you should have something that resembles:
Login View > Navigation Controller > Table View Controller > Detail View Controller
Assuming you are creating a storyboard, the navigation controller can be easily added by selecting the table view controller and choosing Editor > Embed in > Navigation Controller.
Alternatively, if you want the navigation controller solely for a table view that is embedded within a view controller object, I recommend creating a container view in the view controller to display the table view and associated navigation controller.
To accomplish the latter, drag a container object into the view controller and size it to fit the table view that you want to display. Delete the view controller that the container view automatically creates.
Next, create a table view controller and segue to it from the container view. This segue will be an 'embed' segue. Lastly, you can then embed the table view controller you just created in a navigation controller and add the push segue from the table view controller to the detail view controller.
I think here you not use UINavigationController as a RootViewController.. and you use UIViewController as a rootViewController.. so may be this problem with this error
Just try to Follow this steps for the output..
Drag a new navigation controller into your storyboard - it will by default be attached to a tableview controller
Delete the tableview controller Right click on the navgiation controller, and connect the "Root View Controller" property to your existing view controller
Move the entry point arrow from your view controller to the root view controller
UPDATE:
see this example which through you can put validation and clearly push in your detailview...
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:#"AddPlayer"])
{
UINavigationController *navigationController =
segue.destinationViewController;
PlayerDetailsViewController
*playerDetailsViewController =
[[navigationController viewControllers]
objectAtIndex:0];
playerDetailsViewController.delegate = self;
}
}
My storyboard that has the UISplitViewController as the initial view controller. Its master view has a UITableView embedded in a navigation controller, and there is a detail view controller which contains a MKMapView. Clicking on the table cell of the first table view segues into second table view controller.
Clicking on the cell of the second table view segues into second detail view, which is an image view. The segue type is "Replace" with the destination of "Detail Split". Basically, it loads up the image related to the row in second tableView in the detail view.
I am able to navigate back to my first tableview fine. I want to display the first detail view
when the first table view shows up. The reason being that it displays a map view which is related to the contents of the table view. I read quite a bit about it but did not figure out on how to do that. Your help will be really appreciated.
Have you tried adding the following to your first TableViewController
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
// existing code if you have any
[self performSegueWithIdentifier:#"Segue ID for your map" sender:self];
}
In my navigation based application, first view is sign in or signup view. After that i am using a view which is using tab view controller. That view has three tab items. Now i want to create a new view and push in navigationController. But its not working. But adding new view as subView in tabBarController View works. I want navigation for subViews for each tabBarItem? How can i do that?
See this
In your case just create three items and make them all UINavigationControllers like the first tab item in the above example.
I have a TableView, when you click add + button in nav bar, it brings up a modal view that will have another separate table in it which will have subviews etc.
So far, I have the tableViewController and the model view is in there as a UIView. My question is, how do I setup the tableViews that go in the modal view? Do I make new classes for the rootview and subviews etc? Should I switch the modal view to its own class also?
You can put the modal view in a Modal View Controller and do a presentModalViewControllerAnimated to show it.
The modal view controller is a UIViewController subclass and in that class you can manage all the stuff you want to do in your modal view.
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.