Could Not Instantiate Class Named Ibnslayoutconstraint

Could not instantiate class named IBNSLayoutConstraint

You're getting this error because you've set a constraint to an IBOutlet that is removed at runtime. This happens when you set the constraint to be a placeholder in Interface Builder. Since the constraint is removed, when it goes to unarchive it, it throws an error saying it can't do so.

There are two ways to correct this.

Method 1

  1. Right-click on your Storyboard > Open As > Source Code
  2. In the opened storyboard xml, search for placeholder="YES".
  3. You'll find constraints that are set to be removed at runtime. Remove the placeholder attribute from the constraint, save and close.
  4. Run the app and your problem should be fixed.

Method 2

  1. Find the constraint that's causing your problems in Interface Builder. Uncheck the Placeholder option in the GUI. This should be one of the constraints that's set to an IBOutlet in the ViewController that's causing your crash.

Interface Builder attribute editor showing the Placeholder option checked.

This is what it should look like:

Interface Builder attribute editor showing the Placeholder option unchecked.

Alternative

Assuming you actually want the constraint to be a placeholder, then you'll need to remove any referencing outlets. To do this, select the constraint that you wish to be a placeholder. Then open the connections inspector (the button furthest to the right that looks like this: (->) ) and then remove any referencing outlets that may exist on that constraint.

why Xcode 7.2 crash 'Could not instantiate class named IBNSLayoutConstraint'?

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.

Storyyboard localization section

Could not instantiate class named NSLayoutConstraint' while auto layout is disabled

I guess you would have solved the problem by now.
But for others who would stumble into this post, please check this post: https://stackoverflow.com/a/13201690/942966

App crashes with Could not instantiate class named _UIScrollViewLayoutGuide on iOS 10 and older

I had the same issue (using Xcode11 and running iOS 10.3.1).
Unchecking Content Layout Guides from the Scroll View worked for me.

image

Xcode Error: Could not instantiate class named _UIScrollViewLayoutGuide

It seems that I have found an answer! I am unsure why Xcode did not flag the error in the first place. With the new Xcode support for iOS 13, ScrollView Content Layout Guides are automatically enabled. In iOS versions below iOS 11, there is no Content Layout Guide attribute.

I disabled the Content Layout Guides by selecting the Scroll View, going to the Size Inspector and deselecting 'Content Layout Guides' at the bottom of the first section.

This fixed my issue!

NSInvalidUnarchiveOperationException: 'Could not instantiate class named _UITableViewCellSeparatorView'

I was getting the same error after updating to Xcode 5.1.

I was able to get rid of the error by editing the xib for my custom cell.

Under Interface Builder Document in the file inspector, I switched "View as" to "iOS 6.1 and Earlier". I also have "Builds for" set to "iOS 6.0 and Later".

why Xcode 7.2 crash 'Could not instantiate class named IBNSLayoutConstraint'?

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.

Storyyboard localization section

Could not instantiate class named UIRefreshControl Xcode

UIRefreshControl only exists on iOS 6. So if your iPad is running 5.1.1, you won't be able to use UIRefreshControl, because UIRefreshControl did not exist in iOS 5.1.1. So when the nib decoding happens, the decoder finds "UIRefreshControl", it doesn't know what to do with it, and it crashes.



Related Topics



Leave a reply



Submit