In the touchesMoved event handler ... why is this break:
CALayer *slayer = (CALayer*)[[self.layer sublayers] objectAtIndex:0]; slayer.position=CGPointMake(x,y);
but this works fine:
CALayer *slayer = (CALayer*)[[self.layer sublayers] objectAtIndex:0]; [CATransaction begin];
for a subclass of CALayer , but both seem to work for an instance of the CALayer class CALayer ?
More details ...
It's amazing that the application just worked perfectly under iOS 4.3, and now the same code generates EXC_BAD_ACCESS when I try to animate its parameters.
I understand that EXC_BAD_ACCESS generated when a message is sent to an object that has been deleted, so, trying to fix this problem, I made sure that all levels are saved and stored in the cache, so they will remain until I clear the cache. I also check the retention count of the layer in question, and it's 3 , during a call that breaks things, so it seems valid. I tried working with NSZombieEnabled , but it gives the same results and no error messages.
Is there something I am missing? Has something changed between iOS4.3 and iOS5? What causes my supposedly good layer to cut out Core Animation?
fwiw: I am using Xcode 4.2, in June 2009, Macbook Pro.
source share