4

I was wondering, can I use a CADisplayLink Timer instead of an NSTimer even though I'm not doing any animation?

I'd like to call a certain method much like when using an NSTimer, only just at a much higher frequency (60 Hz would be nice), so I was wondering if a CADisplayLink Timer would work even though the method simply does some calculations and not any animation...

P.S. I'm testing on an iPhone 4

Christian Gossain
  • 5,942
  • 12
  • 53
  • 85

1 Answers1

4

I don't see why not. You may even receive better performance from CADisplayLink because it is not performing any animation. The only problem you might run into is how the Apple Review Board will like your use of it.

I would suggest looking over the Class Reference along with the avTouch Sample Code provided before using it.

Evan Mulawski
  • 54,662
  • 15
  • 117
  • 144
  • Why would Apple have any issues with using CADisplayLink as a timer? That's exactly what it was built for, particularly when you need to coordinate actions with the refresh rate of the display. – Brad Larson Nov 27 '10 at 22:51
  • The class reference explicitly states that the CADisplayLink object is used for synchronizing drawing with the display's refresh rate. The OP stated that he needs it for calculations. – Evan Mulawski Nov 28 '10 at 03:05
  • Just a heads up, CADisplayLink will queue if you background your app. NSTimer will run in background. – seo Jul 19 '14 at 18:43