• 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: Mount/Unmount events in Foundation tool
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mount/Unmount events in Foundation tool


  • Subject: Re: Mount/Unmount events in Foundation tool
  • From: Uli Kusterer <email@hidden>
  • Date: Sat, 27 Jan 2007 00:10:16 +0100

Am 26.01.2007 um 00:31 schrieb James Bucanek:
I have a Foundation tool (daemon) that I would very much like to get volume mount and unmount events. I can't get NSWorkspaceDidMountNotification because I can't use NSWorkspace.

Is there some other event I can subscribe to, or is there a way of subscribing to Carbon events for the same action from within a Cocoa app? I already checked NSDistributedNotificationCenter, and it doesn't fire any useful events on volume mount/unmount.

There are CarbonEvents for that, which can be used from a Cocoa app. Though you'd have to try them out to know whether they work in your particular command line tool. I think you'd need a run loop of sorts for those events to be dispatched, and NSApplication dispatches Carbon events during normal event processing. Not sure whether that is because it uses NSRunLoop, or what, though.


The Carbon Events are of class

	kEventClassVolume

and have the following constants as their names:

	kEventVolumeMounted
	kEventVolumeUnmounted

Cheers,
-- M. Uli Kusterer
http://www.zathras.de



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Mount/Unmount events in Foundation tool
      • From: "Finlay Dobbie" <email@hidden>
References: 
 >Mount/Unmount events in Foundation tool (From: James Bucanek <email@hidden>)

  • Prev by Date: Re: Completely broken XCode
  • Next by Date: Re: KVO, design and documentaion
  • Previous by thread: Re: Mount/Unmount events in Foundation tool
  • Next by thread: Re: Mount/Unmount events in Foundation tool
  • Index(es):
    • Date
    • Thread