在OS X上将项目迁移到Xcode 7.2 El Capitan打破了构建

时间:2015-12-09 23:48:48

标签: xcode7 xib nslayoutconstraint osx-elcapitan

我之前使用Xcode 7.1运行OS X Mavericks,我刚刚更新到OS X El Capitan和Xcode 7.2。我的应用程序在模拟器和设备上正常启动,没有任何故事板警告。现在我在storyboard中看到了一堆缺少约束的警告,应用程序因此错误而崩溃:

由于未捕获的异常'NSInvalidUnarchiveOperationException'而终止应用程序,原因:'无法实例化名为IBNSLayoutConstraint的类'

我也试过这里发布的解决方案:Could not instantiate class named IBNSLayoutConstraint

我在xml的任何地方都找不到placeholder =“YES”,而且我的故事板太大了,无法通过每个约束来查看我是否错误地为任何约束打开了Placeholder复选框。

在查看故事板的xml时,我确实看到以下警告。

enter image description here

4 个答案:

答案 0 :(得分:4)

你实际上并没有使用Storyboard,而是使用Xib。在您的文件中,您可以找到以下部分:

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

您需要将.xib打开为“源代码”,然后将其删除,以使约束成为installed

答案 1 :(得分:1)

选择故事板禁用大小类解决我的问题。希望对你有帮助!谢谢 构建项目后,您可以再次启用大小类。

enter image description here

答案 2 :(得分:0)

主要是确保当您使用IB检查您是否没有任何约束时选中“已安装”复选框,如果视图属于他们属于是“未安装”。 Xcode 7.1甚至没有对此发出警告,但7.2会导致崩溃

答案 3 :(得分:0)

故事板上的

--- Use a common table expression to sort and give a rownumber with ctex(ID,product,rate,level)as ( select ID,product,rate, ROW_NUMBER() over (PARTITION BY Id,product order by id,product) as level from ds), -- Use the cte to create another cte with the result of comparison of row1 and row2 of each group seccteX(ID,product,rate,level) as( select a.* from ctex a inner join ctex b on a.ID=b.ID and a.product=b.product and a.level =1 and b.level =2 and abs(a.rate-b.rate )>60 union select b.* from ctex a inner join ctex b on a.ID=b.ID and a.product=b.product and a.level =1 and b.level =2 and abs(a.rate-b.rate )>60 union select b.* from ctex a inner join ctex b on a.ID=b.ID and a.product=b.product and a.level =1 and b.level =2 and abs(a.rate-b.rate )<60 union select a.* from ctex a left join ctex b on a.ID=b.ID and a.product=b.product and a.level =1 and b.level =2 where a.level=1 and b.level is null ) -- Use both cte to compare the results with level 3(row3) of each group -- We can create as many subsets(ctes) based on the levels. but upto a defined max level select a.* from seccteX a inner join ctex b on a.ID=b.ID and a.product=b.product and b.level =3 and abs(a.rate-b.rate )>60 union select b.* from seccteX a inner join ctex b on a.ID=b.ID and a.product=b.product and b.level =3 and abs(a.rate-b.rate )>60 union select b.* from seccteX a inner join ctex b on a.ID=b.ID and a.product=b.product and b.level =3 and abs(a.rate-b.rate )<60 union select a.* from seccteX a left join ctex b on a.ID=b.ID and a.product=b.product and b.level =3 where b.level is null Disable。这应该可以解决你的问题。