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 trialBrooks Wood
Courses Plus Student 2,147 PointsCannot seem to get this answer correct. Any help would be much appreciated.
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.
#import "MusicViewController.h"
@implementation MusicViewController
- (void)viewDidLoad {
[super viewDidLoad];
- (void) addSong {
[self performSegueWithIdentifier:@"showAddSong" sender:self];
}
-(IBAction)addSong {}
@end
2 Answers
Stone Preston
42,016 Pointsyour signature is incorrect. try using - (void)addSong{}
instead of -(IBAction)addSong {}
. IBAction is not the return type, void is.
Brooks Wood
Courses Plus Student 2,147 PointsYou sir are a gentleman and a scholar. =]