LoginSignup
1
1

More than 5 years have passed since last update.

SwiftでSegue...SIGABRT出た時に注意するポイント

Last updated at Posted at 2016-08-18

Swift勉強中です。
なかなか先に進まずイライラしまくってます。
ViewControllerに配置したボタンから、別のViewControllerへ遷移させようと

performSegueWithIdentifier("toTestViewController",sender: nil)

として、

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject!) {
  if (segue.identifier == "toTestViewController") {
    let testViewController : TestViewController = (segue.destinationViewController as? TestViewController)!
  }
}

としたのですが、「testViewController」を取得しようとするとSIGABRTがでてクラッシュしてしまいます。

source.png

なんでだー、と。ギブアップ気味です。

サンプルコード
https://github.com/nmisawa/Segue

追記:
Stroyboardみてたら、Moduleっていう項目があり、そこに設定したら無事動くようになりました。

Custom Classのところ、

empty.png

空っぽでしたが、

module.png

こうしたら動きました。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1