Я на 100 процентов уверен, что все подключено правильно, но я получаю ошибку SIGABRT.
Вот код для SelectViewController:
import UIKit
class SelectViewController: UIViewController {
var accounttype = 0
@IBAction func AdminButton(_ sender: Any) {
}
@IBAction func ParentButton(_ sender: Any) {
}
@IBAction func DriverButton(_ sender: Any) {
}
@IBAction func StudentButton(_ sender: Any) {
accounttype = 1
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
var SubmitController = segue.destination as! SubmitViewController
SubmitController.john = accounttype;
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
Вот код для SubmitViewController:
import UIKit
class SelectViewController: UIViewController {
var accountType = 0
@IBAction func AdminButton(_ sender: Any) {
}
@IBAction func ParentButton(_ sender: Any) {
}
@IBAction func DriverButton(_ sender: Any) {
}
@IBAction func StudentButton(_ sender: Any) {
accountType = 1
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if let destination = segue.destination as? SubmitViewController {
destination.john = accountType
print("Inside if statement")
}
}
override func viewDidLoad() {
super.viewDidLoad()
print("Out of if statement")
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
Вот консоль:
2018-08-28 17:17:56.529276-0700 SchoolDrive[5178:1005170] 5.4.1 - [Firebase/Analytics][I-ACS023007] Firebase Analytics v.50001000 started
2018-08-28 17:17:56.529921-0700 SchoolDrive[5178:1005170] 5.4.1 - [Firebase/Analytics][I-ACS023008] To enable debug logging set the following application argument: -FIRAnalyticsDebugEnabled (see https://help.apple.com/xcode/mac/8.0/#/dev3ec8a1cb4)
2018-08-28 17:17:57.024884-0700 SchoolDrive[5178:1005198] TIC Read Status [1:0x0]: 1:57
2018-08-28 17:17:57.025067-0700 SchoolDrive[5178:1005198] TIC Read Status [1:0x0]: 1:57
2018-08-28 17:18:01.737912-0700 SchoolDrive[5178:1005175] TIC Read Status [2:0x0]: 1:57
2018-08-28 17:18:01.738363-0700 SchoolDrive[5178:1005175] TIC Read Status [2:0x0]: 1:57
2018-08-28 17:18:03.755460-0700 SchoolDrive[5178:1005196] TIC Read Status [3:0x0]: 1:57
2018-08-28 17:18:03.755664-0700 SchoolDrive[5178:1005196] TIC Read Status [3:0x0]: 1:57
Could not cast value of type 'SchoolDrive.SecondRegisterViewController' (0x10d8349d0) to 'SchoolDrive.SubmitViewController' (0x10d834820).
2018-08-28 17:18:04.613651-0700 SchoolDrive[5178:1004484] Could not cast value of type 'SchoolDrive.SecondRegisterViewController' (0x10d8349d0) to 'SchoolDrive.SubmitViewController' (0x10d834820).
(lldb)
Я очень благодарен за любую помощь, и вся помощь приветствуется. Заранее спасибо. Мне нужна вся помощь как можно быстрее. Это облегчит мне. Еще раз большое вам спасибо за всю гепатит, и я очень благодарен.