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

我们两清 提交于 2020-01-13 02:16:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!