This is covered in the ARC docs section 3.3.3 (emphasis mine):
3.3.3 Conversion from retainable object pointer type in certain contexts
[beginning Apple 4.0, LLVM 3.1]
If an expression of retainable object pointer type is explicitly cast to a C retainable pointer type, the program is ill-formed as discussed above unless the result is immediately used:
- to initialize a parameter in an Objective-C message send where the parameter is not marked with the cf_consumed attribute, or to
- initialize a parameter in a direct call to an audited function where the parameter is not marked with the cf_consumed attribute.
In your code, myObject
is a "retainable object pointer." A "C retainable pointer type" include void*
(this is a slightly sloppy definition that they're using as a placeholder because Core Foundation "objects" are often void*
).
So an ObjC object can be implicitly converted to a void*
if used as a method parameter. In that case, there are no additional memory management semantics (i.e. it is the equivalent of a __bridge
cast). Section 7.8 warns us that void*
may not be treated this way in the future, but I wouldn't worry about that. If it happens, adding the __bridge
will be trivial.
The one thing to keep in mind is that myObject
is not protected here. It is up to you to make sure it is retained some other way until the animations complete, or you may crash.