Как передать данные в pplandate, pshipment?
Я получаю ошибку
Поток 1: Неустранимая ошибка: неожиданно обнаружен ноль при развертывании Необязательное значение
class PlanDataViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate, UITextFieldDelegate{
var pshipment: String?
var pplandate: String?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
getPlanDatetoPickerview(ptruckID: ptruckid!)
getShipmenttoPickerView(shiptruckID: ptruckid!, shipplandate: shipmentPlandate)
getPlanDetail(shipment: pshipment, plandate: pplandate). ==>Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value
}//Main Method
func getPlanDatetoPickerview(ptruckID: String)-> Void {
….
self.pplandate = checkPlanDateFullFormat
}
ВыводcheckPlanDateFullFormat ==> 20190118, из pplandate ==> 20190118
func getShipmenttoPickerView(shiptruckID: String, shipplandate: String) -> Void {
….
self.pshipment = checkShipmentFullFormat
}
Вывод checkShipmentFullFormat ==> 4505023529, из pshipment ==> 4505023529
func getPlanDetail(shipment: String, plandate: String)-> Void {
…..
// Driver
let Driver1: String = jsonDictionaryPlanDetail["Driver1"] as! String
let Driver2: String = jsonDictionaryPlanDetail["Driver2"] as! String
let carRegistrtation: String = self.ptruckNo!
…..
}
}