Suppose I want to temporarily change the view frame (for example, move it 10px to the right - perhaps due to the highlight of the change).
I assumed that psuedo code would be something like
self.someView.frame.origin.x += 10.0f;
But it gives me an error
lvalue required as left operand of assignment
So, instead, I create a new CGRect to represent the frame, change this CGRect, and then give the CGRect view as a frame
CGRect aFrame = self.someView.frame;
aFrame.origin.x += 10.0f;
[self.someView setFrame:aFrame];
It seems ridiculous that I can do the job on CGRect, but not on the view frame, which is CGRect.
So, is this the best way to change the frame for an existing view?
And for bonus points: why can't I assign a new value directly to the view property, why do I need to beat “around the bushes”?
thank