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 (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com