A warning is raised in the following code. ARC is used.
if ( aAnim ) {
[UIView beginAnimations:nil context:CFBridgingRetain([NSNumber numberWithInt:aOff])];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(postSpin:finished:toCCWCellOffset:)];
}
CFBridgingRetain
returns aCFTypeRef
which is declared asconst void *
.The
context
parameter of[UIView beginAnimations:context:]
is avoid *
(without theconst
), hence the warning.You can fix that warning by using
__bridge_retained
instead:Note that you have to balance that
retain
by releasing the context when it is no longer used. This can for example be done in the "stop selector" by transferring the ownership back to an Objective-C object: