I’ve been using the following code to move views around, and never had a problem.
I started using ARC in my project for the first time and I am getting the following error on the second line. “Read-only variable is not assignable”
Am I suppose to do this differently with ARC?
CGRect rect = self.frame;
[UIView animateWithDuration:0.4 animations:^{
rect.origin.x = 57;
self.frame = rect;
}];
The problem was that I was using the CGRect inside an animation block.
Marking the variable with __block solved my problem