私はこのprepareForSegue機能が含まれているテーブルビューを持っている:テーブルビューととボタン(クラッシュ)
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let upcoming: CategoryDeviceViewController = segue.destination as! CategoryDeviceViewController
let myindexpath = self.MainPageTableView.indexPathForSelectedRow
let titleString = self.CategoryTitle.object(at: ((myindexpath as NSIndexPath?)?.row)!) as? String
upcoming.titlestring = titleString
self.MainPageTableView.deselectRow(at: myindexpath!, animated: true)
}
6個の細胞からタイトルを取得し、nvigationalバーのタイトルの次のビューにそれらを保存します。
セグ機能の準備が入っているこのビューには、別の(3番目の)ビューコントローラに移動するナビゲーションバーのボタンがあります。
私はそのボタンをクリックするたびに
このライン上のアプリのクラッシュ:let upcoming: CategoryDeviceViewController = segue.destination as! CategoryDeviceViewController
私は、エラーの理由を知っているが、私はそれをどのように解決することができますか?
あなたが知っているエラーの原因は何ですか?あなたの墜落についてログには何が書かれていますか? – Santosh
今度はCategoryDeviceViewControllerにする必要がありますが、ボタンをクリックすると3番目のビューコントローラが開きます – Mariah
この 'segue'のために' destination'viewControllerをあなたのストーリーボードに適切に設定しましたか? – Santosh