warning : Unsupported Configuration: Prototype table cells must have reuse identifiers の解決法
UITableView を Storyboard を利用して作るときによく出るこの warning
Unsupported Configuration: Prototype table cells must have reuse identifiers
要は、 Prototype table cells
なのに reuse identifiers
が無いということです。
この解決方法は2つあります。
- reuse Identifiers を追加する
- Prototype table cells じゃなくする
reuse Identifiers を追加する
Storyboard とコードを組み合わせて、動的にセルの中身を変えたいならこちらです。
tableViewCell を選択し、右ペインの↓から Identifier を追加します。
するとワーニングが消えます。
あとはコード上で cellForRowAtIndexPath で dequeueReusableCell(withIdentifier identifier: String) の identifier に 先程指定した Identifer 与えることで、 cell を取得できます。
Prototype table cells じゃなくする
Storyboard 上で完結するタイプのテーブルビューならこちらで良いでしょう。
Storyboard 上で tableView
を選択し、右ペインの↓から
Content > Dynamic Prototypes を Static Cells に変更します。