Re: NSTimer access to its -timerFireMethod
Re: NSTimer access to its -timerFireMethod
- Subject: Re: NSTimer access to its -timerFireMethod
- From: Graham Cox <email@hidden>
- Date: Wed, 14 Jul 2010 22:27:34 +1000
On 14/07/2010, at 10:06 PM, John Love wrote:
> I think I have found the problem, but I would like confirmation ... the calls are from the main Thread, immediately followed by the display of a sheet. I am trying to intercept errors while the sheet shows. And while the sheet shows, all access to -timerFireMethod is temporarily halted.
You need to schedule the timer to run in the run loop mode that is used for sheets and other modal processes. By default it does not, and will be suspended as long as the sheet or modal dialog is running.
see [NSRunLoop addTimer:forMode] and the mode you need is NSModalPanelRunLoopMode. If you also want it to fire while menus and buttons are being tracked, also add it to NSEventTrackingRunLoopMode
--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