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

I dont understand this build a self destructing message App challenge.

The challenge says: Inside the new 'addSong' method, add the code that performs the segue to the second view controller. In the storyboard for this app, the segue we want to perform has its identifier set as "showAddSong".

But i have no idea what method to use for that. i looked up some methods in the documentation but they all require the name of the destination and source. But the challenge only presents a segue identifier.

This is the code so far:

import "MusicViewController.h"

@implementation MusicViewController

  • (void)viewDidLoad { [super viewDidLoad]; }

-(void)addSong {

}

@end

2 Answers

Nevermind It was in the video right before it i just missed it.

My code is not working and I am not sure why exactly. I am trying to follow the video, and this is what they have for me to enter...at least i think.

#import "MusicViewController.h"

@implementation MusicViewController

- (void)viewDidLoad {
    [super viewDidLoad];  
     - (void) addSong { [self performSegueWithIdentifier:@"showAddSong" sender:self]; }

}

-(IBAction)addSong {}


@end

You have to write the addSong method out of the viewDidLoad method without the IBAction add song.