• 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: Events, drive mounts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Events, drive mounts


  • Subject: Re: Events, drive mounts
  • From: David Jeffery <email@hidden>
  • Date: Wed, 8 Jun 2005 16:02:45 -0700

Take a look at NSWorkspace.  You will need to do something like this:


- (void)awakeFromNib { ...

NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
NSNotificationCenter *notificationCenter = [workspace notificationCenter];


    [notificationCenter addObserver: self
                           selector: @selector(didMount:)
                               name: @"NSWorkspaceDidMountNotification"
                             object: workspace];
    ...

- (void)didMount: (NSNotification *)notification
{
NSString *device = [[notification userInfo] objectForKey: @"NSDevicePath"];
...



David

On Jun 8, 2005, at 15:47 , Shon wrote:

Is there a Cocoa framework for registering for events?  Specifically,
drive mount events.  The only code sample I've found is
CarbonCocoaTempConverter, which calls Carbon APIs for registering for
events.  The search results return the Carbon API documentation for
event handling.  Does a "pure Cocoa" event handling API (Framework?)
exist?

Thanks for your help!

--Shon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40comcast.net


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Events, drive mounts
      • From: Shon <email@hidden>
References: 
 >Events, drive mounts (From: Shon <email@hidden>)

  • Prev by Date: In Window Toolbar (Like iPhoto)
  • Next by Date: Re: Binding to column headers
  • Previous by thread: Events, drive mounts
  • Next by thread: Re: Events, drive mounts
  • Index(es):
    • Date
    • Thread