LoginSignup
6

More than 5 years have passed since last update.

posted at

updated at

xibでCustomCellを作成した際のエラー

問題のエラー

カスタムセルをXibで作ったところ実行時に下記のエラーが出てハマりました。
'NSInternalInconsistencyException', reason: 'invalid nib registered for identifier (AddMenuCell) - nib must contain exactly one top level object which must be a UITableViewCell instance'

原因

原因はカスタムセルのXibファイルの中。
位置を考えながら移動しているうちにひとまずCellの外に置いたLabelが残っており、これを別のViewとして認識されたいたのが原因。

スクリーンショット

解決策

Labelを消せば問題なく動作しました

参考情報

stackoverflowの情報

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
What you can do with signing up
6