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! While you're at it, check out some resources Treehouse students have shared here.

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

Use of undeclared Identifier 'PlaylistDetailController' in Objective C

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.identifier isEqual:@"showPlaylistDetail"]) {

        PlaylistDetailViewController *playlistDetailController = (PlaylistDetailViewController *)segue.destinationViewController;

        playlistDetailController.segueLabelText = @"Yay! You pressed the button!";
    }
}

I'm getting two errors here in the playlistBrowser iOS application. Both are: "Use of undeclared identifier 'playlistDetailController'

4 Answers

That is a custom class, so In your main.storyboard you have to give that name(playlistDetailController) to the view controller. (select the view controller and go to your identity inspector on your utilities area and change the class).

I have that in my app, but it's still not working. I cannot figure out what is different in mine. https://github.com/randallkanna/playlistBrowser

The name of your implementation and interface files are wrong. it should be PlaylistDetailViewController and you have playlistDetailViewController ( you have it with p lowercase and it should be uppercase ). and then just change that on you code as well and it should work. Good luck. just have to be more careful with those details.

Thank you so much! That fixed the issue for me! :-)

i'm always happy to help :)