私はリンゴのチュートリアルhereを追っているとエラーに遭遇していますXcodeのエラー:
2016-01-12 09:34:32.909 FoodTracker[1812:124509] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier MealTableViewCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
プログラムの実行時にエラーが表示され、赤のラインを強調私は、ブレークポイントを通って見られるようにこれらの私は信じているコードの行は、エラーの原因となっているされているAppDelegate.swift
のクラスラインに表示されます。
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cellIdentifier = "MealTableViewCell"
let cell = tableView.dequeueReusableCellWithIdentifier(cellIdentifier, forIndexPath: indexPath) as! MealTableViewCell
// Configure the cell...
let meal = meals[indexPath.row]
cell.nameLabel.text = meal.name
cell.photoImageView.image = meal.photo
cell.ratingControl.rating = meal.rating
return cell
}
私はオンラインで見てきましたが、多くの答えは、TableCellに識別子があることを保証すると言いましたが、私の場合でもエラーは依然としてポップアップしています。
私はさらに情報を投稿する必要がある場合はお知らせください。念のため事前
あなたはどちらかを経由して、あなたのセルを登録していますインターフェイスビルダーまたはコード経由ですか? – luk2302
* "3.属性インスペクタで、Identifierと表示されているフィールドを見つけ、MealTableViewCellと入力してReturnキーを押します。 これは重要なステップです。 – luk2302
はい、私はそれをしましたが、それでもエラーがスローされます...理由は分かりません – demar