问题
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.
回答1:
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
.
回答2:
Select Storyboard Disable Size class resolve my problem. Hope this will help you! Thanks After build your project you can again enable size class.
回答3:
well mainly make sure that when you’re using IB to check that you don’t have any constraints with the “installed” checkbox checked if the view they belong to is “not installed”. Xcode 7.1 doesn’t even give a warning about this, but 7.2 causes a crash
回答4:
Disable
AutoLayout
on your storyboard. This should fix your problem.
来源:https://stackoverflow.com/questions/34191232/migrating-project-to-xcode-7-2-on-os-x-el-capitan-breaks-the-build