6

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

Community
  • 1
  • 1
EmbCoder
  • 562
  • 1
  • 7
  • 16

4 Answers4

5

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.

Sandy Chapman
  • 11,133
  • 3
  • 58
  • 67
  • That did work! I don't understand whether they were always there or whether they got added while migration. Do you know if anything can be done in IB to ensure it doesn't happen again? – EmbCoder Dec 10 '15 at 00:59
  • 1
    Usually this doesn't happen unless you check the tick box in IB to disable the "installed" state. – Sandy Chapman Dec 10 '15 at 01:02
1

Select Storyboard Disable Size class resolve my problem. Hope this will help you! Thanks After build your project you can again enable size class.

enter image description here

Arvind Kumar
  • 2,371
  • 1
  • 18
  • 25
  • 1
    Isn't that basically the same thing as saying, "destroy your user interface and then re-build it"? Apps with a large UI would lose almost all of their size class configuration by disabling size classes. This work-around should really only be considered a "nuclear" option as a last resort. – Daniel J Dec 14 '15 at 21:37
0

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

Mohamed Emad Hegab
  • 2,665
  • 6
  • 39
  • 64
  • For each of the constraint on the storyboard, at least one "installed" checkbox is checked by default. I don't know how that works or what different checkboxes mean but they seem to not cause any issues. – EmbCoder Dec 15 '15 at 19:26
0

Disable AutoLayout on your storyboard. This should fix your problem.

spaceMonkey
  • 4,475
  • 4
  • 26
  • 34