2013年2月16日土曜日

Could not instantiate class named NSLayoutConstraint



iOS SDK 6のstoryboardを使用したアプリをiOS 5で動かすと次のようなエラーが発生することがあります。
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'

stroyboardのプロパティーで"Use Autolayout"のチェックを外すと解消します。

NSLayoutConstraintはiOS 6で追加されものなので、それ以前のバージョンにも対応する必要がある場合は使用できません。

[参考リンク]
http://stackoverflow.com/questions/11252057/nslayoutconstraint-crashes-viewcontroller

0 件のコメント: