• 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: NSRunLoop question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRunLoop question


  • Subject: Re: NSRunLoop question
  • From: Brian Webster <email@hidden>
  • Date: Wed, 14 Aug 2002 14:14:03 -0500

On Wednesday, August 14, 2002, at 01:03 PM, Gerben Wierda wrote:

On Wednesday, August 14, 2002, at 06:15 , Brian Webster wrote:

The docs for -[NSRunLoop run] state "If there are no input sources in the run loop, it exits immediately". So, removing your port from the run loop should cause it to stop running.

Yes, that is what I read too. So, I tried this but I must be doing something wrong, because it does not work.

I'm not sure what other input sources could be in your run loop, but if you call getCFRunLoop on the NSRunLoop and then CFShow() the result, you'll get a complete description of all the sources in the underlying CFRunLoop. That might give you an idea of what's preventing the run loop from stopping. The CFRunLoopStop() function might also be of interest.

Another thing you could do would be to make a while loop and repeatedly call runMode:untilDate:, which is basically what the run method does anyway, only you can terminate the while loop by setting a flag when your server is done with what it needs to do.

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: NSRunLoop question (From: Gerben Wierda <email@hidden>)

  • Prev by Date: setUsesUserKeyEquivalents
  • Next by Date: drag and drop in nsbrowser (issues with matrix and mouseDragged)
  • Previous by thread: Re: NSRunLoop question
  • Next by thread: Releasing Memory when using "TrivialThreads"
  • Index(es):
    • Date
    • Thread