Re: Disk insert event
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