• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Event loop expiration date insight
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Event loop expiration date insight


  • Subject: Event loop expiration date insight
  • From: Graham Cox <email@hidden>
  • Date: Wed, 31 Oct 2012 15:58:45 +1100

I'm handling some mouse dragging tasks modally by implementing my own modal event loop using [NSApp nextEventMatchingMask:untilDate:inMode:dequeue:].

I'm wondering what is the usual correct thing to pass for the 'untilDate' parameter. For a long time I've been using [NSDate distantFuture], but the documentation of this method says that by passing nil it uses [NSDate distantPast], which implies perhaps that this is a more usual default. In thinking about this I realise I don't really understand what this parameter is doing, especially when 'distantPast' is specified - does that mean do not wait at all for any events and only return one if it's already queued?

I've changed this to pass nil and my mouse dragging works as normal.

What set me looking at this is a strange report of this loop going screwy for one user, which I can't reproduce. According to the logs from that user, suddenly several 'mouseUp' events are delivered one after the other which seems impossible, and that confuses my code. Can anyone think of any reason why multiple mouseUps could be delivered (i'm passing YES for the dequeue parameter)? I'm wondering if a third-party extension could be interfering with events somehow - anyone heard of anything like that?


--Graham



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Event loop expiration date insight
      • From: Greg Parker <email@hidden>
    • Re: Event loop expiration date insight
      • From: Vincent Habchi <email@hidden>
  • Prev by Date: Re: CFNetworking and ARC (was: ARC conversion help - CFErrorRef* and NSError**)
  • Next by Date: Re: Event loop expiration date insight
  • Previous by thread: iOS always tells us that the user declined push notifications, even when that's BS.
  • Next by thread: Re: Event loop expiration date insight
  • Index(es):
    • Date
    • Thread