Sigabrt error causes programmatically segue in Swift

I am new to iOS development and am currently trying to programmatically call segue after a cell is selected in UITableViewController

. Although I have already created a segue in my storyboard and assigned an ID to it, I still get sigabrt error when calling a method performSegueWithIdentifier

in an overridden method didSelectRowAtIndexPath

. Any help would be greatly appreciated.

override func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) 
{
    self.performSegueWithIdentifier("toExerciseInfo", sender: self)
}

      

+3


source to share


2 answers


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 pay it in advance ...



This is a problem that can arise if you have a bad storyboard connection for a view controller. In my case, I plugged the button into an outlet, then removed the outlet, leaving a dangling connection. I was able to fix this quite easily by ctrl + clicking on the view in the storyboard, visually looking at the listed connections and deleting the one that is no longer valid. I'm sure there are other ways to fix the error, but what worked for me.

+3


source


It might help somebody someday.

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



dispatch_async(dispatch_get_main_queue(), ^{
                [self performSegueWithIdentifier:@"customplayer" sender:self];
            });

      

0


source







All Articles