title: The view hierarchy is not prepared for the constraint: <NSLayoutConstraint:0x14ddbdc0 V:[UIToolbar:0x14dbb790]-(0)-[_UIKBCompatInputView:0x14df6a30]>
body: <p>I'm having problem in my iOS8 project when I switch from one UItextField to another with inputAccessoryView from XIB.</p>
  
  <p>The view hierarchy is not prepared for the constraint: 
      When added to a view, the constraint's items must be descendants of that view (or the view itself). This will crash if the constraint needs to be resolved before the view hierarchy is assembled. Break on -[UIView _viewHierarchyUnpreparedForConstraint:] to debug.</p>
  
  <p>2014-10-06 12:26:12.656 [722:184153] *** Assertion failure in -[UIInputSetHostView _layoutEngine_didAddLayoutConstraint:roundingAdjustment:mutuallyExclusiveConstraints:], /SourceCache/UIKit/UIKit-3318.0.1/NSLayoutConstraint_UIKitAdditions.m:558</p>
  
  <p>2014-10-06 12:26:12.658 [722:184153] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Impossible to set up layout with view hierarchy unprepared for constraint.'</p>
  
  <pre><code>- (void)textFieldDidBeginEditing:(UITextField *)textField
  {
  currentTextField = textField;
  keyBoardToolBar.hidden = NO;
  
  textField.inputAccessoryView = keyBoardToolBar;
  [keyBoardToolBar removeFromSuperview];
  [textField becomeFirstResponder];
  if (IDIOM != IPAD)
      medicationTableVIew.contentInset = UIEdgeInsetsMake(0, 0, 240, 0);
  }
  
  -(BOOL)textFieldShouldReturn:(UITextField *)textField
  {
  [keyBoardToolBar removeFromSuperview];
  [textField resignFirstResponder];
  return YES;
  }
  </code></pre>