Disk insert event
Disk insert event
- Subject: Disk insert event
- From: Matt Mashyna <email@hidden>
- Date: Thu, 12 Oct 2006 20:16:20 -0400
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