setValue:forUndefinedKey

   使用 Storyboard 创建并管理 UI 时,在运行 app 的时候出现了 2013-10-15 09:21:03.212 TestMSR[610:11303] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<MainViewController 0x7557c30> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key star.'

      检查 storyboard 的 outlet 时也没发现自己连接过 star.....甚是奇怪。

      在此处http://stackoverflow.com/questions/9950938/setvalueforundefinedkey/12302157#12302157
     发现 了答案。
     原来是昨天创建过 star outlet ,后来把它删除了,但是 storyboard 的 source code 并没有更新。

    solutions:  open .storyboard as source code, 删除关于 “star” 的 links,返回 xcode 重新编译。
    问题解决!
     

猜你喜欢

转载自lisai.iteye.com/blog/1958219