Swiftでコーディングするのは初めてですが、UIViewControllerの内部にUITableViewを挿入しようとしていますが、画面にナビゲートするとUITableView、次のエラーでアプリがクラッシュすると:NSUnknownKeyException:このクラスはキーのキー値に符合していません
2016-12-08 14:22:47.265712 Evil Quest[300:18048] Unknown class QuestCell in Interface
Builder file.
2016-12-08 14:22:47.270248 Evil Quest[300:18048] *** Terminating app due to uncaught
exception 'NSUnknownKeyException', reason: '[<UITableViewCell 0x101847600>
setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
lblQuestName.'
私は私が間違ってやっているとありますので、もし私が、私はここに投稿すべき私のコードの一部ではわからないものを、非常にわからないんだけどあなたはこの問題を解決するために必要なコードの一部を私に教えてもらい、それを質問に追加します。
ありがとうございます。
EDIT:
cellForRowAt機能:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell:QuestCell = tableView.dequeueReusableCell(withIdentifier: "QuestCell", for: indexPath as IndexPath) as! QuestCell
let row = indexPath.row
cell.lblQuestName.text = quests[row].name
return cell
}
QuestCellクラスコード:
import UIKit
class QuestCell: UITableViewCell {
@IBOutlet weak var lblQuestName: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
あなたcellForRowAtIndexPathメソッドのコードを投稿してください。 –
問題はあなたのセルに関連しています。あなたの質問に関連するコードを追加してください。 QuestCellクラスも同様です。 –
@SagarSnehi、この機能は? –