Re: NSTimer and -[NSObject performSelector:withObject:afterDelay:] in the background?
Re: NSTimer and -[NSObject performSelector:withObject:afterDelay:] in the background?
- Subject: Re: NSTimer and -[NSObject performSelector:withObject:afterDelay:] in the background?
- From: Jim Correia <email@hidden>
- Date: Wed, 15 Feb 2006 21:07:01 -0500
On Feb 15, 2006, at 7:27 PM, Camillo Lugaresi wrote:
On 15/feb/06, at 19:59, Jim Correia wrote:
I have an application which, upon receiving an apple event in the
background starts a timer with
[[NSTimer scheduledTimerWithTimeInterval: 0 target: self selector:
@selector(doPostProcessing:) userInfo: nil repeats: NO];
The docs say that passing 0 will cause NSTimer to choose "a
nonnegative interval", of unspecified duration. I don't think
that's the issue here, especially if everything works when the
event is received in the foreground (does it?), but you might want
to try passing a small positive value instead of 0.
Passing 0 doesn't appear to be the issue. In fact I just built a
small sample app and it works correctly there.
I should have done more debugging before posting the question in the
first place. The real problem is that the timer wasn't scheduled
(because NSManagedObjectContext changes are not automatically
processed in the background.)
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden