• 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 not firing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTimer not firing


  • Subject: Re: NSTimer not firing
  • From: Alastair Houghton <email@hidden>
  • Date: Sun, 9 Aug 2009 17:26:01 +0100

On 9 Aug 2009, at 16:56, email@hidden wrote:

I'm running an NSInvocationOperation in an NSOperationQueue and set up a listener for the operation's "isFinished" notification. My "observeValueForKeyPath" method is getting called when the operation finishes, but I'm finding that when I try to create a timer inside " observeValueForKeyPath," it never fires. I double checked the "seconds" input to [NSTimer scheduledTimerWithTimeInterval method and it's on;y 5 seconds so it's not like I'm inadvertently using a really long interval. It just never fires.

From the docs for NSOperation:

  Because an operation may execute in any thread, any KVO notifications
  associated with that operation may similarly occur in any thread.

I think the problem, therefore, is that you're trying to schedule your timer
on the wrong thread (I guess you're expecting it to be scheduled on your app's
main thread)?


Kind regards,

Alastair.

--
http://alastairs-place.net



_______________________________________________

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


  • Follow-Ups:
    • Re: NSTimer not firing
      • From: Jerry Krinock <email@hidden>
References: 
 >NSTimer not firing (From: email@hidden)

  • Prev by Date: NSTimer not firing
  • Next by Date: Re: [iPhone 3.0] correct way to release a UIImageView flip animation?
  • Previous by thread: NSTimer not firing
  • Next by thread: Re: NSTimer not firing
  • Index(es):
    • Date
    • Thread