There seems to be something basically wrong with the NSLayoutConstraint implementation. Creating a Category on NSLayoutConstraint and overwriting some methods for debugging purposes revealed the following:
The runtime attributes must be stripped by Xcode during compile time, because of the following reasons:
The overwritten KVC methods inside the NSLayoutCategory
setValue:forKey:
,setValue:forKeyPath:
andsetValue:undefinedKey:
are never getting called.The overwritten method
setIdentifier:
gets called, but never receives the passed value from the runtime attributes sectionProviding invalid keys does not create errors like on any other object, for example a NSView:
2014-03-19 08:25:52.806 LayoutTestApp[13733:303] [ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key testKey.
Additionally, setting a custom class on NSLayoutConstraint gets also gracefully ignored by Xcode (the custom classes' init methods are never getting called). It looks like Apple disabled the runtime attributes and custom class feature for NSLayoutConstraints or it's just a bug. Either way: setting the identifier via runtime attributes will most likely not work atm.