Reputation: 481
*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named IBNSLayoutConstraint'
I just update Xcode to 7.2 then i start to check is everything alright. but I have this error and it crashes. I dig this problem, everybody said that "Make sure you don't have any constraints installed for views that aren't installed." but I don't have any uninstalled constrains. and I don't have any NSLayoutConstraint outlets. Thanks a lot.
Upvotes: 20
Views: 5702
Reputation: 8247
It is easy to solve without applying the hackery mentioned in the above answer. Switch your IB to any/any and look through the subviews of each topview. If you find a super view that is not installed and subview of it installed, disable this installed subview in any/any so that the super view and the subviews will have same status of installation.
Upvotes: 1
Reputation: 2971
I have an app that sets custom size classes for iPad so app recognizes Portrait and Landscape orientations as Regular/Compact and Compact/Regular traits.
So, when I had one view installed only as both R/C Installed and C/R Installed, I got crash: 'Could not instantiate class named IBNSLayoutConstraint' when I upgraded to 7.2 final.
Fix is very simple: to add view install for Any/Any: "Installed"
By comparing Storyboard source it appears that this line was removed after fixing:
// y4d-LA-PwQ is view specific ID
Upvotes: 1
Reputation: 1736
In my case I had "padView" that was not installed in any/any size class and was installed in regular/regular size class, but it's subviews were installed in all size classes.
"PadView" settings:
"PadView" subviews settings:
When I changed "PadView" subviews installation settings to the same as "PadView" settings my problem was resolved.
Upvotes: 10
Reputation: 68
I had a view deactivated (not installed) in my main view in IB. I deleted it and also deleted all the constraints without reference to IB. And worked for me.
Upvotes: 3
Reputation: 2411
Select Storyboard Disable Size class resolve my problem. Hope this will help you! Thanks After build your project you can again enable size class.
Upvotes: 24
Reputation: 3698
You probably using InterfaceBuilder Storyboard for localization. You should also consider them and remove inactive constraits inside them or use Localizable Strings for localization.
You can also check this answer.
Upvotes: 4
Reputation: 782
I did have a similar issue in where I received a "Could not instantiate class named IBNSLayoutContraint" error when one of my apps loaded my XIBs. It ended up being one of my contraints had a check mark on it's properties. It was something like "Remove from Build". I unchecked it and resolved my error. I don't think this is the solution to your problem.
Upvotes: 0