'Receiver () has no segue with identifier 'addSegue'

后端 未结 4 1695
离开以前
离开以前 2020-11-27 08:31

I have a navigation controller that has a segue links between them called \"addSegue\". When I click on the tableView cell though the app crashes and I get the

相关标签:
4条回答
  • 2020-11-27 08:38

    I had this same problem and actually my problem was that I was calling

    WRONG: [self.navigationController performSegueWithIdentifier:@"ShowVerify" sender:self];
    

    instead of

    CORRECT: [self performSegueWithIdentifier:@"ShowVerify" sender:self];
    

    so check that you are calling correct performSegueWithIdentifier method :)

    0 讨论(0)
  • 2020-11-27 08:38

    Check whether UIKIT being or not in header file. I unknowingly made new VC a subclass of View Controller.

    0 讨论(0)
  • 2020-11-27 08:57

    Hard to say for sure, but some other people have had similar problems:

    • In this question, the asker instantiated the storyboard with init instead of instantiateViewControllerWithIdentifier so the segue wasn't set up properly.

    • In this question, it was just something weird going on internally with xcode and the simulator, and running Product->Clean helped.

    • And of course, it's possible the segue name in the code doesn't match the segue name on the Storybord, but I'm guessing you've checked that a lot of times already!

    0 讨论(0)
  • 2020-11-27 08:58

    enter image description here

    use segue identifier in Push Method and give the proper connection
    

    if you are using Identifier, then call this line where u need

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

    Swift 2.X

    self.performSegueWithIdentifier("identifierName", sender: self)
    

    Swift 3

    self.performSegue(withIdentifier: "identifierName", sender: self)
    

    Regarding the new screen you have added that way. In that screen, when you're finished and want to remove it, it's just:

    self.dismiss(animated: false, completion: nil)
    
    0 讨论(0)
提交回复
热议问题