title: iOS Auto Layout: Set the trailing space equal to the width of the superview
body: <p>I need to position a view just outside the right bound of its superview using auto layout.</p>
  
  <p>I'm trying to do this by specifying the following NSLayoutConstraint:</p>
  
  <pre><code>NSLayoutConstraint *leftConstraint = [NSLayoutConstraint constraintWithItem:self.downloadView
                                                                    attribute:NSLayoutAttributeLeft
                                                                    relatedBy:NSLayoutRelationEqual
                                                                       toItem:self.contentView
                                                                    attribute:NSLayoutAttributeWidth
                                                                   multiplier:1.0
                                                                     constant:0.0];
  </code></pre>
  
  <p>Where self.downloadView holds is a subviews of self.contentView.
  By doing so iOS complain with the following exception:</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSLayoutConstraint constraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:]: Invalid pairing of layout attributes'
  </code></pre>
  
  <p>Someone can explain why I can't pair this two attributes and how can I achieve my goal?</p>