LoginSignup
0
1

More than 3 years have passed since last update.

ちゃんと紐づけてるのにunrecognized selector sent to instanceエラーが出る時の対処方法

Posted at

このエラーに数日悩まされたので備忘録として残します。

Bar Button Itemタップ時の処理を実装していたところ、
以前までは正常に実装できていたものが、「unrecognized selector sent to instance」のエラーで前に進めなくなった。

調べてみると、いくつか要因があるとのこと

  1. identity inspectorのClassの設定が間違っている
  2. Inherit Module From Targetにチェックが入っていない(自分はこれが原因だった)
  3. タップ時のアクションを示す関数にて、引数(例:_ sender: UIBarButtonItem)が設定されていない

(2が原因の場合、Inherit Module From Targetにチェックを入れるか、もしくは、Moduleに手打ちすればよいとのこと)

参考になればいいな

0
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
0
1