Search code examples
xcode7xibnslayoutconstraintosx-elcapitan

Migrating project to Xcode 7.2 on OS X El Capitan breaks the build


I was running OS X Mavericks before with Xcode 7.1, I just updated to OS X El Capitan and Xcode 7.2. My app was launching fine on the simulator and device without any kind of warnings for storyboard. Now I see a bunch of warnings for missing constraints in storyboard and the app crashes with this error:

Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named IBNSLayoutConstraint'

I also tried the solution posted on here : Could not instantiate class named IBNSLayoutConstraint

I couldn't find placeholder="YES" anywhere in xml and my storyboard is too big to actually go through each constraint to see if I by mistake have turned on Placeholder checkbox for any constraint.

I do see the following warnings when viewing xml of the storyboard.

enter image description here


Solution

  • You're in fact not using a Storyboard, but a Xib. In your file you'll find sections such as this:

    <mask key="constraints">
        <exclude reference="6fq-cy-xp8"/>
    </mask>
    

    You'll want to open your .xib as "Source Code" and remove these so that the constraints become installed.