LoginSignup
25
5

More than 5 years have passed since last update.

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

Last updated at Posted at 2016-05-04

問題のエラー

カスタムセルを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の情報

25
5
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
25
5