1

I have a project in swift 2.3 in Xcode 8.2 beta, This project run nicely in iOS < 10, but when I run iOS 10 this project crash with no reason preforming the segue. shows this error:

fatal error: unexpectedly found nil while unwrapping an Optional value

this is the code line

NSOperationQueue.mainQueue().addOperationWithBlock {
     self.performSegueWithIdentifier("goToActivityDetail", sender: nil)
}

I don'w know whats happened, but is not even call the method

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {

please help me! I'm desperate with the compatibility between iOS 10 and Swift 2.3 or iOS 9.3 and Swift 3

1 Answers1

0

your segue "goToActivityDetail" exist in the storyboard? and when you add the override you are setting the type of your controller? some like this:

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        if segue.identifier == "goToActivityDetail"{
            let v = segue.destinationViewController as! yourControllerName
        }
    }
cristian franco
  • 266
  • 2
  • 13