prepareForSegue not called when UITableView row selected?

后端 未结 2 618
一整个雨季
一整个雨季 2021-01-11 11:27

I have setup a UITableView using a NSFetchedResultsController that displays a number of prototype UITableViewCells. I have hooked up a push segue from my UITableViewCell to

相关标签:
2条回答
  • 2021-01-11 11:42

    Rewire your segue from the ViewController itself and give it a name. Then in the didSelectRow method call

    [self performSegueWithIdentifier:@"yourSegueName"];    
    

    and see if it fires.

    0 讨论(0)
  • 2021-01-11 11:47

    After a bit of digging I eventually found that the UITableViewCell identifier was set incorrectly to "CELL_ID" when it should have been "PLANTCELL_ID".

    Som for anyone else who finds that selecting a UITableViewCell in a UITableView does not call the associated segue, check if your cell identifier is set correctly in both the storyboard and tableView:cellForRowAtIndexPath:.

    0 讨论(0)
提交回复
热议问题