0

这看起来像一个基本的 IB 错误,但它并没有解决。

*** Terminating app due to uncaught execption 'NSUnknownKeyExecption', reason:'[<TrailersViewController 0x585e8e0> setValue:forUndfinedKey:]: this class is not key value coding-compliant for the key myImageView.' 
  1. myImageView 不在 TrailersViewController 中,它在 TrailersViewController 上的另一个对象中。

  2. myImageView 没有任何 IBOutlets。

  3. 第三,在推送视图控制器时似乎会遇到这个问题,但它的对象显示在子视图中。

  4. myImageView 只是对象中的一个局部变量。

我也有这个工作,但注意到我的 TrailersViewController 相当泄漏,所以我正在重新组织它以阻止这些泄漏。

我现在不知所措,但我能进入的任何其他方向都会很棒。

4

1 回答 1

2

似乎您已将 nib 中的 myImageView 视图关联到 TrailersViewController 中名为 myImageView 的 @property IBOutlet,但您忘记了 @synthesize 此属性。因此,当运行时尝试使用键值方法将从 nib 加载的 myImageView 对象分配给 myImageView 实例时,它找不到 setter 方法,因为您没有合成它。

于 2011-08-03T20:36:09.897 回答