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 trialTroy Fine
7,592 PointsStuck on Code Challenge
Task 1 of 2:
"In the view controller below about songs, tapping on a button to add a new song needs to perform a segue to another view controller. The button is wired up to an IBAction with the signature '- (void)addSong'. Start by defining this method."
Everything I'm trying isn't working. Any help is appreciated.
7 Answers
Fernando Claussen
9,324 PointsThe addSong method should be like this:
[self performSegueWithIdentifier:@"showAddSong" sender:self];
first you reference yourself, then you call the performSegueWithIdentifier method, tells what the identifier is and set the sender. There you go.
Stone Preston
42,016 Pointsthe challenge asks you to define the method. so all you have to do is
- (void)addSong {
}
Christian Deciga
5,600 Pointsjust below the viewDidLoad
J Kim
15,218 PointsSome of these questions really need to worded better. It really bugs me that time is being wasted because of these non-specific directions.
J Kim
15,218 PointsHonestly sometimes it seems to be better to not have a question than to have a bad one. Some of these questions on the site sometimes are vague, misleading, and sometimes down right wrong. I like the fact that there are variety of ways of enforcing what we've learned, but having some quiz because it's just the part of the format feels really counter-intuitive at times.
Troy Fine
7,592 PointsThat makes sense, thanks a lot.
Troy Fine
7,592 PointsCool, not sure why but I'm still lost when it comes to segues.
Got stuck again on second part of this challenge...
Here is my code for it.
-(void)addSong { [segue:showAddSong destinationViewController]; }
Tried other methods but I still can't figure it out.
Parker Skiba
5,583 PointsHonestly I got stuck on this challenge more because of the ambiguity of the question and not the actual coding. Fixed it now though :).