title: "View hierarchy unprepared for constraint..."
body: <p>For those of you who've gone through cs193p, I'm actually completing the 3rd assignment currently for the latest course.</p>
  
  <p>I've even used Martin Mandl's excellent blog as a reference to resolve most issues. </p>
  
  <p>However! </p>
  
  <p>For those that don't know, I'm building a simple tab bar app. All of the functionality in the code itself is working. I can put in breaks and it's not until AFTER -(void)viewDidLoad that the error occurs. This is an issue somehow related to storyboard.</p>
  
  <p>Here's the entire call stack and preceding error details. Any ideas?</p>
  
  <pre><code>2014-08-29 12:00:46.749 Matchismo[19897:60b] View hierarchy unprepared for constraint.
      Constraint: &lt;NSIBPrototypingLayoutConstraint:0x8d5c440 'IB auto generated at build time for view with fixed frame' UIButton:0x8d59700.left == UIView:0x8d5a800.left + 20&gt;
      Container hierarchy: 
  &lt;UIView: 0x8d5a800; frame = (0 0; 320 568); autoresize = RM+BM; layer = &lt;CALayer: 0x8d5a860&gt;&gt;
     | &lt;UIButton: 0x8d55b80; frame = (68 72; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d55c70&gt;&gt;
     | &lt;UIButton: 0x8d4cff0; frame = (116 72; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d4d0e0&gt;&gt;
     | &lt;UIButton: 0x8d57fa0; frame = (164 72; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d58090&gt;&gt;
     | &lt;UIButton: 0x8d56400; frame = (212 72; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d564f0&gt;&gt;
     | &lt;UIButton: 0x8d561e0; frame = (260 72; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d562d0&gt;&gt;
     | &lt;UIButton: 0x8d56a60; frame = (20 120; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d56b50&gt;&gt;
     | &lt;UIButton: 0x8d58600; frame = (68 120; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d586f0&gt;&gt;
     | &lt;UIButton: 0x8d56620; frame = (116 120; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d56710&gt;&gt;
     | &lt;UIButton: 0x8d57b60; frame = (164 120; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d57c50&gt;&gt;
     | &lt;UIButton: 0x8d581c0; frame = (212 120; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d582b0&gt;&gt;
     | &lt;UIButton: 0x8d56c80; frame = (260 120; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d56d70&gt;&gt;
     | &lt;UIButton: 0x8d56ea0; frame = (20 168; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d56f90&gt;&gt;
     | &lt;UIButton: 0x8d55da0; frame = (68 168; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d55e90&gt;&gt;
     | &lt;UIButton: 0x8d58c60; frame = (116 168; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d58d50&gt;&gt;
     | &lt;UIButton: 0x8d59920; frame = (164 168; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d59a10&gt;&gt;
     | &lt;UIButton: 0x8d4d1f0; frame = (212 168; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d4d2e0&gt;&gt;
     | &lt;UIButton: 0x8d58a40; frame = (260 168; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d58b30&gt;&gt;
     | &lt;UIButton: 0x8d583e0; frame = (20 216; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d584d0&gt;&gt;
     | &lt;UIButton: 0x8d58e80; frame = (68 216; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d58f70&gt;&gt;
     | &lt;UIButton: 0x8d57940; frame = (116 216; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d57a30&gt;&gt;
     | &lt;UIButton: 0x8d570c0; frame = (164 216; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d571b0&gt;&gt;
     | &lt;UIButton: 0x8d58820; frame = (212 216; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d58910&gt;&gt;
     | &lt;UIButton: 0x8d572e0; frame = (260 216; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d573d0&gt;&gt;
     | &lt;UIButton: 0x8d57d80; frame = (20 264; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d57e70&gt;&gt;
     | &lt;UIButton: 0x8d56840; frame = (68 264; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d56930&gt;&gt;
     | &lt;UIButton: 0x8d590a0; frame = (116 264; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d59190&gt;&gt;
     | &lt;UIButton: 0x8d594e0; frame = (164 264; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d595d0&gt;&gt;
     | &lt;UIButton: 0x8d55fc0; frame = (212 264; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d560b0&gt;&gt;
     | &lt;UIButton: 0x8d4cb90; frame = (260 264; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d4c620&gt;&gt;
     | &lt;UIButton: 0x8d592c0; frame = (20 312; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d593b0&gt;&gt;
     | &lt;UIButton: 0x8d57500; frame = (68 312; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d575f0&gt;&gt;
     | &lt;UIButton: 0x8d4e990; frame = (116 312; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d4ea80&gt;&gt;
     | &lt;UIButton: 0x8d59b40; frame = (164 312; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d59c30&gt;&gt;
     | &lt;UIButton: 0x8d4f6c0; frame = (212 312; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d4f7b0&gt;&gt;
     | &lt;UIButton: 0x8d57720; frame = (260 312; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d57810&gt;&gt;
     | &lt;UILabel: 0x8d5a550; frame = (20 393; 222 21); text = 'Score: 0'; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = &lt;CALayer: 0x8d5a600&gt;&gt;
     | &lt;UIButton: 0x8d59d80; frame = (250 389; 50 30); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d59e70&gt;&gt;
     | &lt;UILabel: 0x8d5a310; frame = (20 360; 280 21); text = ''; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; userInteractionEnabled = NO; layer = &lt;CALayer: 0x8d539d0&gt;&gt;
     | &lt;_UILayoutGuide: 0x8d5a9a0; frame = (0 0; 0 0); hidden = YES; layer = &lt;CALayer: 0x8d5aa10&gt;&gt;
     | &lt;_UILayoutGuide: 0x8d5aab0; frame = (0 0; 0 0); hidden = YES; layer = &lt;CALayer: 0x8d5ab20&gt;&gt;
      View not found in container hierarchy: &lt;UIButton: 0x8d59700; frame = (20 72; 40 40); opaque = NO; autoresize = RM+BM; layer = &lt;CALayer: 0x8d597f0&gt;&gt;
      That view's superview: NO SUPERVIEW
  2014-08-29 12:00:46.756 Matchismo[19897:60b] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Unable to install constraint on view.  Does the constraint reference something from outside the subtree of the view?  That's illegal. constraint:&lt;NSIBPrototypingLayoutConstraint:0x8d5c440 'IB auto generated at build time for view with fixed frame' UIButton:0x8d59700.left == UIView:0x8d5a800.left + 20&gt; view:&lt;UIView: 0x8d5a800; frame = (0 0; 320 568); autoresize = RM+BM; layer = &lt;CALayer: 0x8d5a860&gt;&gt;'
  *** First throw call stack:
  (
      0   CoreFoundation                      0x01a401e4 __exceptionPreprocess + 180
      1   libobjc.A.dylib                     0x0158d8e5 objc_exception_throw + 44
      2   CoreFoundation                      0x01a3ffbb +[NSException raise:format:] + 139
      3   Foundation                          0x011c655f -[NSLayoutConstraint _addToEngine:integralizationAdjustment:mutuallyExclusiveConstraints:] + 197
      4   Foundation                          0x011c99ad -[NSLayoutConstraint _addToEngine:] + 56
      5   UIKit                               0x008ea974 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 515
      6   Foundation                          0x0134068c -[NSISEngine withBehaviors:performModifications:] + 107
      7   Foundation                          0x011d03c5 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
      8   UIKit                               0x008eae40 -[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 63
      9   UIKit                               0x008ea754 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 476
      10  UIKit                               0x008eae48 -[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 71
      11  UIKit                               0x008ea54f -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 223
      12  UIKit                               0x008ea46b -[UIView(AdditionalLayoutSupport) _parentalLayoutEngineDidChangeTo:] + 55
      13  UIKit                               0x008ea850 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 223
      14  Foundation                          0x0134068c -[NSISEngine withBehaviors:performModifications:] + 107
      15  Foundation                          0x011d03c5 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
      16  UIKit                               0x008eae40 -[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 63
      17  UIKit                               0x008ea754 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 476
      18  UIKit                               0x008eae48 -[UIView(AdditionalLayoutSupport) _withAutomaticEngineOptimizationDisabledIfEngineExists:] + 71
      19  UIKit                               0x008ea54f -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 223
      20  UIKit                               0x002af24d __40-[UIView(Hierarchy) layoutBelowIfNeeded]_block_invoke + 416
      21  Foundation                          0x0134068c -[NSISEngine withBehaviors:performModifications:] + 107
      22  Foundation                          0x011d03c5 -[NSISEngine withAutomaticOptimizationDisabled:] + 48
      23  UIKit                               0x002aef1a -[UIView(Hierarchy) layoutBelowIfNeeded] + 327
      24  UIKit                               0x002aedcd -[UIView(Hierarchy) layoutIfNeeded] + 74
      25  UIKit                               0x0039ca2c -[UITabBarController _layoutViewController:] + 296
      26  UIKit                               0x0039cbd4 -[UITabBarController _wrapperViewForViewController:] + 248
      27  UIKit                               0x003a4141 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 441
      28  UIKit                               0x003a3943 -[UITabBarController transitionFromViewController:toViewController:] + 63
      29  UIKit                               0x0039fbed -[UITabBarController _setSelectedViewController:] + 281
      30  UIKit                               0x0039facc -[UITabBarController setSelectedViewController:] + 180
      31  UIKit                               0x003a383f -[UITabBarController _tabBarItemClicked:] + 312
      32  libobjc.A.dylib                     0x0159f880 -[NSObject performSelector:withObject:withObject:] + 77
      33  UIKit                               0x0024f3b9 -[UIApplication sendAction:to:from:forEvent:] + 108
      34  UIKit                               0x0024f345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
      35  UIKit                               0x00513629 -[UITabBar _sendAction:withEvent:] + 479
      36  libobjc.A.dylib                     0x0159f82b -[NSObject performSelector:withObject:] + 70
      37  UIKit                               0x0024f3b9 -[UIApplication sendAction:to:from:forEvent:] + 108
      38  UIKit                               0x0024f345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
      39  UIKit                               0x00350bd1 -[UIControl sendAction:to:forEvent:] + 66
      40  UIKit                               0x00350fc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
      41  UIKit                               0x00350c06 -[UIControl sendActionsForControlEvents:] + 48
      42  UIKit                               0x0051823d -[UITabBar(Static) _buttonUp:] + 123
      43  libobjc.A.dylib                     0x0159f880 -[NSObject performSelector:withObject:withObject:] + 77
      44  UIKit                               0x0024f3b9 -[UIApplication sendAction:to:from:forEvent:] + 108
      45  UIKit                               0x0024f345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
      46  UIKit                               0x00350bd1 -[UIControl sendAction:to:forEvent:] + 66
      47  UIKit                               0x00350fc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
      48  UIKit                               0x00350243 -[UIControl touchesEnded:withEvent:] + 641
      49  UIKit                               0x0028eddd -[UIWindow _sendTouchesForEvent:] + 852
      50  UIKit                               0x0028f9d1 -[UIWindow sendEvent:] + 1117
      51  UIKit                               0x002615f2 -[UIApplication sendEvent:] + 242
      52  UIKit                               0x0024b353 _UIApplicationHandleEventQueue + 11455
      53  CoreFoundation                      0x019c977f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
      54  CoreFoundation                      0x019c910b __CFRunLoopDoSources0 + 235
      55  CoreFoundation                      0x019e61ae __CFRunLoopRun + 910
      56  CoreFoundation                      0x019e59d3 CFRunLoopRunSpecific + 467
      57  CoreFoundation                      0x019e57eb CFRunLoopRunInMode + 123
      58  GraphicsServices                    0x03a345ee GSEventRunModal + 192
      59  GraphicsServices                    0x03a3442b GSEventRun + 104
      60  UIKit                               0x0024df9b UIApplicationMain + 1225
      61  Matchismo                           0x00009c5d main + 141
      62  libdyld.dylib                       0x02087701 start + 1
  )
  libc++abi.dylib: terminating with uncaught exception of type NSException
  </code></pre>