Re: Perform Selector After Delay Secondary Window
Re: Perform Selector After Delay Secondary Window
- Subject: Re: Perform Selector After Delay Secondary Window
- From: Wim Lewis <email@hidden>
- Date: Wed, 19 Mar 2008 18:16:49 -0700
On Mar 19, 2008, at 6:00 PM, Matt Long wrote:
[self performSelector:@selector(checkPlayback:)
withObject:currentTimeValue afterDelay:0.15]
While the secondary window is open, checkPlayback never gets
called. As soon as the window gets closed, though, all of these
events pile up at my break point in checkPlayback. Of course, at
that point, it is too late. The time when I needed it to fire has
passed.
-performSelector:afterDelay: works via the run loop (perhaps using an
NSTimer, I forget). Any run loop source (such as a timer waiting to
fire) works in some set of run loop modes. AppKit defines a handful
of modes that it uses, including the normal everyday run loop mode,
one that's used during modal dialogs, one during mouse-tracking
loops, etc.
Anyway, check the documentation of NSRunLoop / CFRunLoop for run loop
modes, and of the -performSelector:withObject:afterDelay:inModes:
method.
_______________________________________________
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