Re: NSTimer question...
Re: NSTimer question...
- Subject: Re: NSTimer question...
- From: Anthony Duer <email@hidden>
- Date: Tue, 12 Apr 2005 23:22:08 -0700
Per NSTimer's documentation: "The [target] method must take only one
argument, an NSTimer object." Try using:
- (void)noAnswer: (NSTimer *)timer
Hope that helps. :)
~Anthony Duer
On Tuesday, April 12, 2005, at 10:25 PM,
email@hidden wrote:
I have a method like this... in my main Controller...
- (void)noAnswerIn:(NSTimeInterval)seconds
{
// Create a new timer with the new refreshtime.
if (noAnswerTimeout == nil) {
NSLog(@"Starting no-answer timer");
noAnswerTimeout = [NSTimer
scheduledTimerWithTimeInterval:seconds
target:self
selector:@selector(noAnswer:)
userInfo: nil
repeats:NO];
}
}
- (void)noAnswer:(id)sender
{
NSLog(@"I never get here");
// I do my stuff here if after a period of "seconds" above expires.
// of course we have to do this to ditch our timer when done.
[noAnswerTimeout invalidate]; // Ditch the timer - no longer
needed.
noAnswerTimeout = nil; // Loose reference to it.
}
I never get to the noAnswer callback. What am I missing?
What things can I do to check into why this isn't working?
John
_______________________________________________
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