Re: Delayed perform never performing
Re: Delayed perform never performing
- Subject: Re: Delayed perform never performing
- From: James Walker <email@hidden>
- Date: Fri, 24 Aug 2018 13:09:30 -0700
On 8/24/18 11:21 AM, James Walker wrote:
What could cause a delayed perform (using -[NSObject performSelector:
withObject: afterDelay:]) to never happen? The requested delay is
0.175. I've checked that it's being issued from the main thread, and
I've checked that cancelPreviousPerformRequestsWithTarget: is not being
called. I wondered if I needed to do the delayed perform in a
particular run loop mode, and found that [[NSRunLoop currentRunLoop]
currentMode] is nil, which seems odd. Why would the run loop not be
running?
Never mind, I figured it out. I had to add inModes:
@[NSModalPanelRunLoopMode]. The code had been working when my
formerly-Carbon app was using RunApplicationEventLoop, but now that I've
switched
to NSApplicationMain, apparently modal loops have started using
NSModalPanelRunLoopMode.
_______________________________________________
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