Re: NSOperation Question
Re: NSOperation Question
- Subject: Re: NSOperation Question
- From: Ken Thomases <email@hidden>
- Date: Wed, 7 Jan 2009 19:42:15 -0600
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