Expression is not assignable
I have an object (a custom UIView) in which I have this property in the public API:
@property (nonatomic) CGPoint theOrigin;
then, in the implementation file I have:
@synthesize theOrigin = _theOrigin;
also in the implementation file I have the method:
-(void)setDefaultOrigin {
_theOrigin.x = self.bounds.origin.x + self.bounds.size.width/2;
_theOrigin.y = self.bounds.origin.y + self.bounds.size.height/2;
}
which doesn't generate any compiler complaints but if I try to code the above method
like this:
-(void)setDefaultOrigin {
self.theOrigin.x = self.bounds.origin.x + self.bounds.size.width/2;
self.theOrigin.y = self.bounds.origin.y + self.bounds.size.height/2;
}
I get a complaint on both lines of the method stating that the "Expression is not assignable"
and it won't allow me to build. I am not understanding why I can't code it the second way.