Ios 在删除Xcode 8和Swift 3.0中的覆盖后准备segue崩溃

Ios 在删除Xcode 8和Swift 3.0中的覆盖后准备segue崩溃,ios,swift,xcode,Ios,Swift,Xcode,在从Xcode 8 beta 5升级到Xcode 8最终版本,并从我的所有prepare for segue方法中删除覆盖后,所有这些方法都在运行时崩溃 下面是我的代码示例: 这是按钮的操作方法: @IBAction func actionRequested(_ sender: AnyObject) { if sender as! UIButton == shoppingButton { print("executed from inside of action

在从Xcode 8 beta 5升级到Xcode 8最终版本,并从我的所有prepare for segue方法中删除覆盖后,所有这些方法都在运行时崩溃

下面是我的代码示例:

这是按钮的操作方法:

@IBAction func actionRequested(_ sender: AnyObject) {

    if sender as! UIButton == shoppingButton
    {
        print("executed from inside of actionRequested Method")
        performSegue(withIdentifier: "toShopping", sender: self)
    }
}
这是一种为segue做准备的方法

// MARK: - Navigation
func prepare(for segue: UIStoryboardSegue, sender: AnyObject?) {
    print("executed from inside of prepare For segue method")
    if segue.identifier == "toShopping"
    {
        let newHomeViewController = segue.destination as!  HomesTableViewController
        newHomeViewController.profile = self.profile
    }

}
这就是错误:

executed from inside of actionRequested Method
fatal error: unexpectedly found nil while unwrapping an Optional   value
2016-09-16 10:30:06.194590 Fredi[2567:551009] fatal error: unexpectedly found nil while unwrapping an Optional value  
请注意,我所有的prepareforsegue方法在删除覆盖之前都是有效的,现在我在所有方法中都得到了相同的错误。有人能告诉我解决这个问题的正确方向吗


先谢谢你

不要删除
覆盖
,这是在隐藏问题,而不是解决问题。Xcode 8 beta 6中的prepare for segue方法的签名已更改

现在应该是:

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {

一、 最后,通过重新安装Xcode并使用Dan提出的方法签名解决了这个问题


谢谢你的回复

那么,当我把它放回Xcode 8最终版本时,为什么会出现编译器错误?你在我的回答中使用了
Any
而不是
AnyObject
?是的,它工作了,但只有在我重新安装Xcode之后。不知道为什么以前没有使用新签名。谢谢你的帮助。这解决了我的问题,我已经做到了。谢谢你的建议。