Reputation:
I created the single view application using storyboard.
In storyboard file, i have three view controller
1-navigation controller 2-Recipe Book View Controller 3-View Controller
Prototype cell of the table view of Recipe Book View Controller is connected through push segue to View Controller.Is the problem Recipe Book View Controller does not navigate to View Controller? here is the sample of project for download. https://drive.google.com/open?id=0B5pNDpbvZ8SnLTd1R3NBTE1ReEk
Upvotes: 0
Views: 144
Reputation: 8351
Based on your Source code you have to add some code & classes in your project to achieve your requirement.
1st You have to add RecipeViewController
to control your Recipe List and Tableview both.
2nd as You have created this RecipeViewController
you need to assign this class to respective ViewController
in your storyboard.
3rd Assign Segue from PrototypeCell to ViewController where you need to push.
Hope you can understand whats wrong in your Code.
Upvotes: 0
Reputation: 539
I just Check your project.
Do following steps:-
In Main.storyboard
, click on Push segue to ViewController
and add name of identifier
Go to ViewController.m
and paste below code
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self performSegueWithIdentifier:@"yourSegueName" sender:self];
}
Upvotes: 1
Reputation: 1
Select the segue connecting RecipeBookViewController to ViewController , Then give that segue an identifier, i.e. "ViewControllerSegue".
Implement the delegate method of table view and call the performSegueWithIdentifier method :
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self performSegueWithIdentifier:@"ViewControllerSegue" sender:tableView];
}
Upvotes: 0
Reputation: 9503
Following mistakes are found in your project.
didSelect
tableview delegate.Upvotes: 0