4

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

[animation setTimingFunction:(CAMediaTimingFunction*)UIViewAnimationCurveEaseInOut];
Mark Hall
  • 53,938
  • 9
  • 94
  • 111
CKK
  • 53
  • 3

1 Answers1

17

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*.

Lily Ballard
  • 182,031
  • 33
  • 381
  • 347