Re: Getting disk mount notification with Foundation tools
Re: Getting disk mount notification with Foundation tools
- Subject: Re: Getting disk mount notification with Foundation tools
- From: Douglas Davidson <email@hidden>
- Date: Mon, 10 Jun 2002 11:07:57 -0700
On Friday, June 7, 2002, at 11:53 PM, Mike Vannorsdel wrote:
I have a Foundation tool and I need to get disk mounting notifications.
Since it's a Foundation tool, I can't use AppKit's NSWorkspace methods.
I've tried linking to AppKit and registering for the notification, but
didn't receive the notification (or any workspace notifications for that
matter). I did get a valid NSWorkspace object which did have a valid
notification center. But the instance of NSWorkspace was not the same
as
the "real" AppKit applications were getting, which probably explains the
lack of any notifications.
I believe the problem here is that NSWorkspace itself receives its
notifications of disk mounting and unmounting (which it then passes on
to its clients) on the application's main thread--there is a similar
issue for the application launch and quit notifications. Since it is a
part of AppKit, NSWorkspace is entitled to assume and does assume the
presence of an NSApplication object to assist it, and this further
implies the notion of a main thread on which NSApplication runs its main
event loop, and so forth. This is not really a bar to using it from
within a command-line tool, but it does mean that some care may need to
be taken. Let me know if you are not able to get this working.
Douglas Davidson
_______________________________________________
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.