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

Re: NSOperation Question


  • Subject: Re: NSOperation Question
  • From: Sandro Noel <email@hidden>
  • Date: Wed, 07 Jan 2009 21:00:32 -0500

Thanks Ken i was not aware of run Loops, besides the one for the mail app
I did not know i could just create one like that :)


i'll try that.

Sandro Noel.

On 7-Jan-09, at 8:42 PM, Ken Thomases wrote:

On Jan 7, 2009, at 6:45 PM, Sandro Noel wrote:

How would I go about having an operation stay alive as long as my application is alive,

If this is what you want, then it's no longer an operation, it's just a thread. Don't use NSOperation for this.



I use DiskAppearedCallback / DiskDisappearedCallback from the DiskArbitration Framework
in my application and I want the to be in their separate thread.

Why do you want them to be in a separate thread? The run loop is designed specifically to allow for monitoring of various input sources without the need to spawn threads.



How can i have the thread not quit as soon as the callback's are registered?

If you really want to use a thread, add a dummy NSPort to the thread's run loop and then just run the run loop. The thread will just sit in the run loop and process DiskArbitration callbacks when they happen.


Cheers,
Ken


_______________________________________________

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: NSOperation Question
      • From: Sandro Noel <email@hidden>
References: 
 >NSOperation Question (From: Sandro Noel <email@hidden>)
 >Re: NSOperation Question (From: Ken Thomases <email@hidden>)

  • Prev by Date: re: Large Core Data memory allocations for small rows
  • Next by Date: Re: NSOperation Question
  • Previous by thread: Re: NSOperation Question
  • Next by thread: Re: NSOperation Question
  • Index(es):
    • Date
    • Thread