2

I call a doPoof method using NSTimer as following:

[NSTimer scheduledTimerWithTimeInterval:0.2 target:self selector:@selector(doPoof:) userInfo:myCALayer repeats:FALSE];

How to replace the above using CADisplayLink instead of an NSTimer?

PrimeSeventyThree
  • 940
  • 2
  • 9
  • 24

1 Answers1

0

Why do you want to change away from NSTimer?

The point of using CADisplayLink is so that animations can be timed according to the video refresh interval.

For a simple, non-repeating, call, NSTimer is perfectly valid.

Abizern
  • 146,289
  • 39
  • 203
  • 257
  • 1
    Well, I'm stuck with trying to debug problems with my animations using a sprite sheet. My guess the problem I have is that NSTimer not accurate enough and once in a while my animation doesn't hit exactly at a time when is should which leads to wrong contentsRect and displays me just a middle part of my sprite sheet instead of a piece that it should cut out....I want to try CADisplayLink in hope that it might help. – PrimeSeventyThree Jun 16 '11 at 12:53