i meant main app.

On 7-Jan-09, at 9:00 PM, Sandro Noel wrote:

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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/sandro.noel%40mac.com

This email sent to sandro.n...@mac.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to