sigabrt error calling segue programmatically in Swift

前端 未结 2 546
北海茫月
北海茫月 2020-12-21 04:09

I am new to iOS development and am currently attempting to call a segue programmatically after a cell in a UITableViewController is selected. Although I already

相关标签:
2条回答
  • 2020-12-21 04:34

    I realize this is an old post, but it showed up at the top of a google search and I was able to solve my problem by reading the comments. Just to pay it forward...

    This is a problem that can occur when you have a bad connection from your storyboard to the view controller. In my case, I'd connected a button to an outlet, then deleted the outlet, leaving a dangling connection. I was able to fix it fairly easily by ctrl+clicking the view in the storyboard, visually inspecting the connections listed, and then deleting the one that was no longer valid. I'm sure there are other ways to fix the error, but that's what worked for me.

    0 讨论(0)
  • 2020-12-21 04:53

    This might help someone someday.

    Make sure you call the segue on the main thread or it will crash (SIGABRT):

    dispatch_async(dispatch_get_main_queue(), ^{
                    [self performSegueWithIdentifier:@"customplayer" sender:self];
                });
    
    0 讨论(0)
提交回复
热议问题