Passing object with prepareForSegue Swift

后端 未结 4 1187
清歌不尽
清歌不尽 2020-12-15 06:32

I am trying to pass an object to another scene with prepareForSegue()

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObj         


        
4条回答
  •  死守一世寂寞
    2020-12-15 06:56

    What that error is telling you is that segue.destinationViewController isn't a VehicleDetailsTableViewController. We don't have enough details to tell you why.

    Check your segues and make sure they're all pointing to the correct place, and always check the identifier of your segue before you perform a cast.

    if segue.identifier == "theNameOfYourSegue" // then do your cast
    

提交回复
热议问题