title: AutoLayout constraint issue with unexpected NSAutoresizingMaskLayoutConstraint
body: <p>I'm using auto layout constraints programmatically and I am constantly seeing the same kind of error across my application usually related to a constraint that looks like this:</p>
  
  <pre><code>"&lt;NSAutoresizingMaskLayoutConstraint:0x82da910 h=--&amp; v=--&amp; V:[UITableViewCellContentView:0x82d9fb0(99)]&gt;"
  </code></pre>
  
  <p>I've put some sample code to reproduce at <a href="https://github.com/nicolasccit/AutoLayoutCellWarning" rel="nofollow noreferrer">https://github.com/nicolasccit/AutoLayoutCellWarning</a></p>
  
  <p>In this example, I am creating a very simple view with 2 UI elements: an image view called imageThumbnail and a label called labelName with some constraints:</p>
  
  <pre><code>"H:|-padding-[_imageThumbnail(==imageWidth)]-[_labelName]";
  "V:|-padding-[_imageThumbnail(==imageHeight)]-padding-|";
  "V:|-padding-[_labelName]";
  </code></pre>
  
  <p>On both elements I set the AutoresizingMaskIntoConstraints to NO.</p>
  
  <p>And I am getting the following exception:</p>
  
  <pre><code>Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
  (
      "&lt;NSLayoutConstraint:0xa6e4f90 V:[UIImageView:0xa6e4340]-(10)-|   (Names: '|':UITableViewCellContentView:0xa6e4150 )&gt;",
      "&lt;NSLayoutConstraint:0xa6e4f10 V:[UIImageView:0xa6e4340(80)]&gt;",
      "&lt;NSLayoutConstraint:0xa6e4ed0 V:|-(10)-[UIImageView:0xa6e4340]   (Names: '|':UITableViewCellContentView:0xa6e4150 )&gt;",
      "&lt;NSAutoresizingMaskLayoutConstraint:0xa6e4ac0 h=--&amp; v=--&amp; V:[UITableViewCellContentView:0xa6e4150(99)]&gt;"
  )
  
  Will attempt to recover by breaking constraint 
  &lt;NSLayoutConstraint:0xa6e4f90 V:[UIImageView:0xa6e4340]-(10)-|   (Names: '|':UITableViewCellContentView:0xa6e4150 )&gt;
  </code></pre>
  
  <p>I know the last constraint is related to the content view but I am unclear to properly remove it (Setting<br>
  AutoresizingMaskIntoConstraints to NO on the contentView raises an error and in the SO link below, it messes up the entire layout):</p>
  
  <pre><code>&lt;NSAutoresizingMaskLayoutConstraint:0xa6e4ac0 h=--&amp; v=--&amp; V:[UITableViewCellContentView:0xa6e4150(99)]&gt;
  </code></pre>
  
  <p>I've seen the answers at: <a href="https://stackoverflow.com/questions/19132908/auto-layout-constraints-issue-on-ios7-in-uitableviewcell">Auto layout constraints issue on iOS7 in UITableViewCell</a> but none of them seem to be working for me here.</p>
  
  <p>I believe that the constraints I define are valid and pretty straightforward but can't seem to figure out what's going on. And I'm seeing the exception being raised both in iOS 6.1 and iOS 7.</p>
  
  <p>Any idea what I am doing wrong here?</p>
  
  <p>Thanks,
  Nicolas</p>