views:

315

answers:

1

I have a game with several small objects animated using CAKeyframeAnimation. Objects animate perfectly for BOTH iPhone and iPad. However, the value of the position property of the animated CALayers' presentationLayers only yield reasonable values on the iPhone. I use the current position of the animating objects for hit testing. Any ideas of differences in this area between iPad and iPhone/iPod Touch?

The position points for iPhone show expected incremental change as objects animate; on iPad I see peculiar values, for example this sequence: <-36893488147419103232.000000,2.607987>, <-0.000000,2.658927>, <0.000000,2.709929>, <36893488147419103232.000000,2.755450>, ...

Other properties of the presentationLayer are correct (these are properties whose values don't change during the animation, however).

After the animation finishes, the presentationLayer position value IS accurate.

A: 

Exactly same problem here!! and it looks that is a bug starting with 3.2 version of the SDK... Actually I did a iPhone app (using 3.1 SDK) that it is completely based on CAAnimation, when I installed and ran the the app on an iPhone with 3.2 nothing works!!!... but on devices that has 3.1 works perfectly. I google it and I found another people with exactly the same problem.

take a look at the bottom of the following forum

http://www.iphonedevsdk.com/forum/iphone-sdk-development/19622-current-position-animating-calayer.html

Could you solved this issue or found a workaround?

Andres Garcia
Andres - thanks for the pointer to others with similar problem. I've been working on higher priority tasks and have not yet resolved this problem.
Bob Fenchel
A post in the apple developer forums claims that there was a bug introduced in 3.2 specific to calculation of presentation values for properties of a CAKeyframeAnimation following a CGPath and that the bug was fixed in iOS 4. This description fits my situation and my observations. I'll probably wait for the iOS for iPad and hope that solves the problem.
Bob Fenchel