title: Why is "expression not assignable" (UIView.frame.origin)?
body: <p><em>This question is not a "how do I" but rather a "why is this" concerning some Class properties in Objective-C.</em></p>
  
  <p>I understand that the two examples below are not allowed and result in an error ("expression not assignable"):</p>
  
  <pre><code>self.myUIView.frame.origin.x = 50;
  self.myUIView.frame.origin = CGPointMake(50,50);
  </code></pre>
  
  <p>and that the proper way to do this is to create a new CGRect, set the values desired and then assign it:</p>
  
  <pre><code>CGRect rect = self.myUIView.frame;
  rect.origin = CGPointMake(50, 50);
  self.myUIView.frame = rect;
  </code></pre>
  
  <p>I'd like to understand why this is. </p>
  
  <p>CGRect is a struct containing two structs. Does the restriction have to do with how structs are allocated, to prevent an assignment which might overflow that memory? Or is it more of a convention concerning public and private properties?</p>
  
  <p>I realize this seems like a minor/basic question but I think it is important to clear up muddy/bad understandings of these fundamental sort of things.</p>