Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Deleted User

project failed help?

  • (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

    if ([segue.identifier isEqualToSring: @"showRecipeDetail"]) { NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; RecipDetailViewController *destViewController = segue.destinationViewController destViewController.recipeName = [recipes objectAtIndex:indexPath.row]; }

4 Answers

David Carson
David Carson
9,400 Points

Looks like you have RecipDetailViewController not Recipe - you forgot the E.

Deleted User

Great catch, but saying: Use of undeclared identifier 'prepareForSegue '

David Carson
David Carson
9,400 Points

Try importing that header file (the .h file) of your destination view controller to your main view controller?

Deleted User

I checked that right away:

RecipeBookViewController.m // RecipeBook

import "RecipeBookViewController.h"

import "RecipeDetailViewController.h"

UGH! USE of undeclared identifier for prepareForSegue (there's a brown underscore under the p in prepare, pointing out the problem

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender if ([segue.identifier isEqualToSring: @"showRecipeDetail"]) { NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; RecipeDetailViewController * destViewController = segue.destinationViewController; destViewController.recipeName = [recipes objectAtIndex:indexPath.row]; }

I've redone it to where I can't do it again. oh well Merry Christmas