问题描述:

Can anyone please suggest alternative to this line of code so that my code becomes compatible with ARC.

[animation setTimingFunction:(CAMediaTimingFunction*)UIViewAnimationCurveEaseInOut];

网友答案:

That code isn't correct even in MRR (non-ARC). The only reason it's not crashing is because UIViewAnimationCurveEaseInOut happens to have the value of 0 (which becomes nil after the cast).

Instead you should be using

[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];

This will do what you're intending to do, except with an actual instance of CAMediaTimingFunction*.

相关阅读:
Top