Linked Questions

Popular Questions

Unrecognised Selector when passing data between views

Asked by At

Im currently trying to pass data to another view controller when a user selects a row within a tableView

The apps keeps terminating with an "unrecognised selector send to instance"

This is the code I'm using to pass the data to the other view, Yes the selectedUUID string exists in the view I'm trying to pass data to

    let data = self.journeyArr[indexPath.row]
    let uuid = (String(data.uuid))

    let Storyboard = UIStoryboard(name: "Main", bundle: nil)
    let JmvC = Storyboard.instantiateViewController(withIdentifier: "JourneyMessageViewController") as! JourneyMessageViewController
    JmvC.selectedUUID = uuid
    self.navigationController?.pushViewController(JmvC, animated: true)

And this is the error im getting when I select a row in the table

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[LoopUltimate.JourneyMessageViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x10950e430'

Related Questions