0

Wouldn't the touchesBegan:withEvent always fire "before" or "after" each iteration of the CADisplayLink callback?

Edit: Here's my CADisplayLink instantiation:

CADisplayLink *aDisplayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(tick:)];
[aDisplayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
Ryan
  • 5,883
  • 13
  • 56
  • 93

1 Answers1

1

Assuming that the display link is connected to the main run loop then yes — it would be impossible for the two to occur at the same time. Cocoa's run loops queue up messages to send, then send them one at a time.

Tommy
  • 99,986
  • 12
  • 185
  • 204
  • I added my CADisplayLink code to the question. If that code were in my app delegate that would be main run loop correct? – Ryan Mar 02 '12 at 03:08
  • Assuming you're performing that on the main thread (which, if you haven't done anything special, you are) then yes — it'll feed into the main run loop. – Tommy Mar 02 '12 at 04:12