title: Creating layout constraints programmatically
body: <p>I know that a lot people already asked tons of questions about this, but even with the answers I can't make it work.</p>
  
  <p>When I'm dealing with constraints on storyboard, it's easy but in code I have a hard time. 
  I try, for example, to have a view that stays on the right side and has the height of the screen according the screen orientation. This is my code:</p>
  
  <pre><code>UIView *myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 748)];
  myView.backgroundColor = [UIColor redColor];
  [self.view addSubview:myView];
  [self.view addConstraints:[NSLayoutConstraint
      constraintsWithVisualFormat:@"V:|-[myView(&gt;=748)]-|"
      options:0 metrics:nil
      views:NSDictionaryOfVariableBindings(myView)]];
  </code></pre>
  
  <p>It doesn't satisfy some constraints. I don't see what is wrong. Also, why can't I use a property like <code>self.myView</code> instead of a local variable like <code>myView</code>?</p>