title: iOS, Swift: "Unable to simultaneously satisfy constraints" in syslog
body: <p>My first iOS app got rejected by the App Review team because it crashed on launch. I can't reproduce this crash. The app runs fine on my physical iPad Mini and on all the Xcode simulators. Also, the same build and archive was passed through TestFlight Internal Testing. I have so far <a href="https://stackoverflow.com/questions/38779523/ios-app-rejected-trying-to-symbolicate-crash-log">not been able to symbolicate the crash logs</a> they sent me. However, I did find this in the syslog:</p>
  
  <pre><code>Aug  7 17:04:44 Michaels-MacBook-Pro-3 SpringBoard[1333]: Unable to simultaneously satisfy constraints.
      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. 
  (
      "&lt;NSLayoutConstraint:0x7fccfccd0300 UILabel:0x7fccfccc8510' '.leading == SPUISearchTableHeaderView:0x7fccfccc59f0.leadingMargin&gt;",
      "&lt;NSLayoutConstraint:0x7fccfccd0f80 H:[UILabel:0x7fccfccc8510' ']-(NSSpace(8))-[UIButton:0x7fccfcccb710'Show More']&gt;",
      "&lt;NSLayoutConstraint:0x7fccfccd0fd0 SPUISearchTableHeaderView:0x7fccfccc59f0.trailingMargin == UIButton:0x7fccfcccb710'Show More'.trailing&gt;",
      "&lt;NSLayoutConstraint:0x7fccfccc8880 'UIView-Encapsulated-Layout-Width' H:[SPUISearchTableHeaderView:0x7fccfccc59f0(0)]&gt;"
  )
  </code></pre>
  
  <p>Looking at this, it seems to pertain to a table view, a label and a button. My app is based on the standard Master-Detail project. So there is only one table view in it, the master, and there is only one label in that view, which is in the prototype cell. At one point, I experimented with a disclosure button in the prototype cell, and I suspect the <code>Show More</code> on the second to the last line above may be a lingering effect from that.</p>
  
  <p>Searching on <code>SPUISearchTableHeaderView</code> I found <a href="https://github.com/CPDigitalDarkroom/iOS9-SpringBoard-Headers/blob/master/System/Library/PrivateFrameworks/SpotlightUI.framework/SPUISearchTableHeaderView.h" rel="nofollow noreferrer">this</a> in github. I notice that it does add a couple of constraints. And those constraints actually contain the text <code>moreButton</code>.</p>
  
  <p>So I feel like I may be on the trail of the cause of the crash: I'm thinking it's some constraints being added programmatically, possibly left over from my experiment with the disclosure button. But I'm not at all sure how to proceed from here.  There are no explicit constraints on the label (see screen shot below), and I don't think there ever were.  Any help will be greatly appreciated!
  <a href="https://i.stack.imgur.com/3Mhw9.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3Mhw9.jpg" alt="screen shot showing label"></a></p>
  
  <p>Based on Konstantin's suggestion below, I tried to add constraints to the label, but the only ones available are horizontal and vertical centering. Others are grayed out. (See screenshot below.)  And when I try to select horizontal centering, the Add Constraints button at the bottom remains grayed out, so I can't add it!</p>
  
  <p><a href="https://i.stack.imgur.com/3XGHT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3XGHT.jpg" alt="enter image description here"></a></p>