Compiler Error: Invalid value in assignment when trying to change the origin of a UISwitch
<p>The following piece of code is giving me a compiler error: Invalid value in assignment, while changing the origin.</p>

<p><code>CGPoint switchOrigin = CGPointMake(currentOrigin.x, currentOrigin.y + kTweenMargin);
UISwitch *choiceSwitch = [UISwitch alloc];
**choiceSwitch.frame.origin = switchOrigin;**</code>  </p>

<p>But when I change it to the following it works properly. </p>

<p><code>CGPoint switchOrigin = CGPointMake(currentOrigin.x, currentOrigin.y + kTweenMargin);
UISwitch *choiceSwitch = [UISwitch alloc];
**CGRect switchFrame = choiceSwitch.frame;
switchFrame.origin = switchOrigin;**</code>  </p>

<p>Can any one explain me the logic behind this.</p>

<p>Thanks and Regards,
Pranathi</p>
