私はこのエラーを取得していたときに私の「他」ブロックの実行の最初の行:Swift3 - 検索クラッシュ表の最初の文字を表示
indentifier PhoneCellでセルをデキューすることができない - ペン先または登録する必要がありますストーリーボードのプロトタイプセルを接続してください
最初のテーブルはうまく読み込んでいますが、検索しようとするとこの例外がスローされます。これは、私がカスタムセルに行った後に起き始めました。ここでは、クラッシュしているテーブルのcellForRowAtIndexPath関数を示します。何が起きているのか?
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if tableView == self.tableView{
let cell = self.tableView.dequeueReusableCell(withIdentifier: "PhoneCell", for: indexPath) as! PhoneSearchResultTableViewCell
cell.nameLabel.text = phones[indexPath.row].name.value
cell.descriptionLabel.text = phones[indexPath.row].descriptionText.value
cell.modelLabel.text = phones[indexPath.row].model.value
return cell
}else{
let cell = self.resultsController.tableView.dequeueReusableCell(withIdentifier: "PhoneCell", for: indexPath) as! PhoneSearchResultTableViewCell
cell.nameLabel.text = filteredPhones[indexPath.row].name.value
cell.descriptionLabel.text = filteredPhones[indexPath.row].descriptionText.value
cell.modelLabel.text = filteredPhones[indexPath.row].model.value
return cell
}
}
あなたはresultsControllerのテーブルビューで 『PhoneCell』の識別子を登録していますか? –