okay so in my application I have one of my classes register for the "NSWorkspaceDidUnmountNotification" notification. Fine. Working, when I eject a volume I get the notification and it calls my function. Cool up to here.
Here is the code in said function.
Note: NSDictionary is a hashtable (if you've never encountered the term)
PHP Code:
NSDictionary *instructions = [note object];
NSLog(@"mediaWasEjected - %@", [instructions valueForKey:@"NSDevicePath"]);
But when it executes I get this error message.
Quote:
2004-01-24 23:58:41.416 iMedia[8611] Exception raised during posting of notification. Ignored. exception: [<NSWorkspace 0x33c2e0> valueForUndefinedKey:]: this class is not key value coding-compliant for the key NSDevicePath.
|
from apple docs, Notifications are at the bottom.
Quote:
NSWorkspaceDidUnmountNotification
Posted when the Finder has unmounted a device.
The notification object is the shared NSWorkspace instance. The userInfo dictionary contains the following information:
Key_______________Value
@"NSDevicePath" ____The path where the device was previously mounted, as a string.
|
So I get the dictionary and ask it for the value with key @"NSDevicePath" but the dictionary says "Nope" and raises a exception.
*sigh*
okay I feel better now.