小编Eth*_*han的帖子

对于密钥取消,此类不符合密钥值编码

我一直收到这个错误: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FoodTracker.MealViewController 0x7faa9ed189d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key cancel.'

我正在尝试完成Apple开发人员指南以开始使用iOS应用程序.我的代码和故事板看起来与他们在示例文件中的完全一样.我希望新鲜的眼睛能够看到我不是的东西?

import UIKit
import os.log

class MealViewController: UIViewController, UITextFieldDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate {

    //MARK: Properties
    @IBOutlet weak var nameTextField: UITextField!
    @IBOutlet weak var photoImageView: UIImageView!
    @IBOutlet weak var ratingControl: RatingControl!
    @IBOutlet weak var saveButton: UIBarButtonItem!
    /*
     This value is either passed by 'MealTableViewController' in
     'prepare(for:sender) or constructed as part of adding a new meal.
    */
    var meal: Meal? …
Run Code Online (Sandbox Code Playgroud)

xcode sigabrt ios swift

18
推荐指数
3
解决办法
2万
查看次数

标签 统计

ios ×1

sigabrt ×1

swift ×1

xcode ×1