I have a tableview and I want to show cell details in another view controller.
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let selectedCell = listAthkar[indexPath.row]
let destinationVC = showCellVC()
destinationVC.cellTitle.text = selectedCell.title
destinationVC.cellDisc.text = selectedCell.details
performSegue(withIdentifier: "showCell", sender: self)
}
showCellVC
has a UILabel
and a textview
which I want to pass data to, the data are coming from core data.
The app crashes every time I press in a cell.
Here is the error I get
fatal error: unexpectedly found nil while unwrapping an Optional value 2017-08-27 02:46:29.315056-0400 AthkarKF[13152:3972483] fatal error: unexpectedly found nil while unwrapping an Optional value
The error I think is self-explanatory, but I'm not sure where is the optional value and I'm not sure if this is the correct way to pass data to another VC.
Can you please help, I would really appreciate it.