1

I have a problem with a segue. I have "next" button:

- (IBAction)NextButton:(id)sender {
//...
[self performSegueWithIdentifier:@"adaugaScore" sender:self];
}

and this:

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
    if ([[segue identifier] isEqualToString:@"adaugaScore"])
    {
        ScoreViewController *scoreVC = segue.destinationViewController;
        scoreVC.score = [NSString stringWithFormat:@"%d",score];
    }
}

My app crashes at this line:

[self performSegueWithIdentifier:@"adaugaScore" sender:self];

With this error:

has no segue with identifier 'adaugaScore''
Gaby Fitcal
  • 1,814
  • 1
  • 17
  • 28

2 Answers2

0

You need to set storyboard id/name(adaugaScore) in your storyboard to your controller. Check : What is a StoryBoard ID and how can i use this? for more information.

EDIT : To use the segue name refer : How do i set a modal segue (programmatically) to a push segue

Community
  • 1
  • 1
Dipen Patel
  • 911
  • 2
  • 9
  • 22
0

Set the segue.identifier to be adaugaScore. This is done by clicking the segue and in the properties panel setting the identifier.

Cen92
  • 171
  • 1
  • 13