• 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: Disk insert event
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disk insert event


  • Subject: Re: Disk insert event
  • From: Matt Mashyna <email@hidden>
  • Date: Thu, 12 Oct 2006 20:26:11 -0400

oops, wrong notification center. need to get it from NSWorkspace

Sorry,
Matt

On Oct 12, 2006, at 8:16 PM, Matt Mashyna wrote:

I have been trying to catch disk mount and unmount events but I can't figure it out. I want to be notified when a volume is either mounted or unmounted. I tried this:

- (void)awakeFromNib
{
		[[NSNotificationCenter defaultCenter] addObserver:self
		selector:@selector(diskMountChanged:)
		name:NSWorkspaceDidMountNotification
		object: [NSWorkspace sharedWorkspace]];
}

and

// tells us if a disk was mounted
-(void)diskMountChanged:(NSNotification *)notification
{
	NSLog(@"Disk mounted");
} // diskMountChanged


I tried to open a dmg and popped in a USB flash drive but I never get an event. What am I doing wrong ?


Thanks,
Matt
_______________________________________________
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


_______________________________________________ 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
References: 
 >Disk insert event (From: Matt Mashyna <email@hidden>)

  • Prev by Date: Disk insert event
  • Next by Date: sheets in separate nibs
  • Previous by thread: Disk insert event
  • Next by thread: sheets in separate nibs
  • Index(es):
    • Date
    • Thread