Lets say that I want to temporarily change the frame of a view (for eg move it 10px to the right - probably in connection with highlighting a change).
I assumed the psuedo code would be something like
self.someView.frame.origin.x += 10.0f;
But this gives me an error of
lvalue required as left operand of assignment
So what I do instead is make a new CGRect to represent the frame, alter that CGRect then give the view the CGRect as it's frame
CGRect aFrame = self.someView.frame;
aFrame.origin.x += 10.0f;
[self.someView setFrame:aFrame];
Seems funny that I can make an assignment on a CGRect, but not on a view's frame which is a CGRect.
So, is this the best way to alter a frame for an existing view?
And for bonus points: Why can't I assign a new value directly on the view's frame property, why do I have to beat 'round the bushes like this?
Thanks