The reason this does not work is due to the mixing of two syntaxes. Once "." is a shortcut for calling the accessor functions (an Objective-C feature). Once "." is a direct struct member access (pure C). Combining this in a set-value-case like this, doesn't work. Because theoretically...
When you could call
myView.frame.origin.x = 25.0;
The "myView.frame" part would get you the CGRect frame (calling sth.like [myView getFrame])
The "myView.frame.origin" part would get you the CGPoint origin
The "myView.frame.origin.x = 25.0" would set the x Value of the origin to 25.0 by directly accessing the CGPoint origin and directly accessing the CGFloat x value (both are struct's as I see now)... but (so I think to understand now) the myView.frame set-accessor wouldn't be called, thus myView wouldn't be notified about the changes.
So what normally happens behind the scenes is that:
myView.frame = newFrame;
will call the accessor function (call being translated to [myView setFrame:newFrame]) which might look like this:
@implementation UIView
- (void) setFrame:(CGRect) frame{
_frame = frame;
[self updateMySelfOrInformOtherComponentThatWantsToKnowAboutChanges];
}
So if you do the "myView.frame = myFrame;" call the other components or whatever will get informed.
But if you say:
myView.frame.origin.x = 25.0;
only the getFrame:frame would get called, returned, and then it's origin would get modified and all this without setFrame function ever being called, cause actually you're not setting it thus the dubious [self updateMySelfOrInformOtherComponentThatWantsToKnowAboutChanges] wouldn't get called.
Well instead you get the "Lvalue required as left operand of assignment" from the compiler which I guess is XCodes way of telling you exactly this :D (no I don't know honestly). Or it must be the mixing of direct struct member access with this accessor methods called with the "dot" syntax.