XCODE / iOS: setValue:forUndefinedKey: 这个 class 不符合键 Destination 的键值编码

XCODE / iOS: setValue:forUndefinedKey: this class is not key value coding-compliant for the key Destination

问题:

我正在尝试从我的 Login View Controller Scene 导航到 iPad Start Menu Scene,但是我收到一条错误消息:

setValue:forUndefinedKey: this class is not key value coding-compliant for the key

然后应用程序崩溃了。我试图在 Interface Builder 中查看我的连接是否有任何问题,并检查我的 Main.storyboard 的源代码是否有任何(明显的)问题。

我真的不确定在这种情况下是什么导致了这个问题,但是非常感谢任何建议。

来源:

https://github.com/androiddeveloperfl/SA3

错误代码段:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Destination.'

错误显示 [setValue:forUndefinedKey:]:此 class 与键 Destination 的键值编码不兼容。,您创建了Destination 在你的 xib 中,之后你在你的 xib 中删除但不在 Connection Inspector 中。 select File's Owner 并点击 "Connection Inspector"(右上箭头),一次查看所有出口。 寻找 !s 表示缺少 outlet.if 你想要这个只需删除连接并再次添加 once.problem 就解决了。

如果在从一个视图控制器导航到另一个视图控制器时显示此错误。 步骤:

  1. 转到项目目标
  2. 在项目目标中select"Build Phases"
  3. 在"Build Phases"select"Compile Sources"
  4. 在 "Compile Sources" 中添加您的视图控制器,即“.m”文件
  5. 构建您的项目并运行