Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.6k views
in Technique[技术] by (71.8m points)

ios - sigabrt error calling segue programmatically in Swift

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 created the segue in my storyboard and assigned it an identifier, I still receive a sigabrt error at the performSegueWithIdentifier method call within an overridden didSelectRowAtIndexPath method. Any help would be greatly appreciated.

override func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) 
{
    self.performSegueWithIdentifier("toExerciseInfo", sender: self)
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...