The error is occurring because you are releasing an object that is already in an Autorelease Pool. When the pool is drained later, the object is already released, and that's when you get the error you see.
Don't release an object if you didn't create it with alloc
or new
or copy
! In your example code, you don't own myAnimation
so you don't need to release it. Period.
Don't look at retainCount
unless you are debugging something really weird. That is all it is there for. And in most cases it won't even help you in those situations.