• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTimer question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTimer question...


  • Subject: Re: NSTimer question...
  • From: Nathan Day <email@hidden>
  • Date: Wed, 13 Apr 2005 14:15:52 +1000

Is your program set to back ground only (no menu bar or Dock icon), if that is the case then there are some issues with NSTimers in this situation. I think they will only fire when you application recieves and event.

On Wednesday, April 13, 2005, at 12:58PM, John Draper <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
>
>


Nathan Day
email@hidden
http://homepage.mac.com/nathan_day/
 _______________________________________________
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

References: 
 >NSTimer question... (From: John Draper <email@hidden>)

  • Prev by Date: Re: Creating a "tool" in objective-C
  • Next by Date: Re: NSSpellChecker crashes after 64k words
  • Previous by thread: NSTimer question...
  • Next by thread: Re: NSTimer question...
  • Index(es):
    • Date
    • Thread