2012年6月16日土曜日

this class is not key value coding-compliant for the key someKey.



reason: '[<MyClass 0x1346b0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key someKey.'

someKeyメソッド, あるいはReadOnlyでなければsetSomeKeyメソッドがない場合に発生します。
次の場合に発生しました。
  • StoryboardでActionを追加する。
  • .hにメソッド宣言、.mに実装が追加される。
  • その後に.h、.mから宣言、実装を削除したが、.storyboardに接続情報が残っている.
次のいずれかの方法で解消する。
  • Storyboardを開き当該接続がある部品のペインを表示、当該接続を解除する。

  • Storyboardをソースで開き、当該Actionの記述を削除する。
    <connections>
       <action selector="someMethod:" destination="2"
                eventType="touchUpInside" id="kdU-9Q-rW1"/>
    </connections>


0 件のコメント: