Tilted Forum Project Discussion Community

Tilted Forum Project Discussion Community (https://thetfp.com/tfp/)
-   Tilted Technology (https://thetfp.com/tfp/tilted-technology/)
-   -   [obj-c] not key value coding-compliant for the key NSDevicePath or F#$King Docs!! (https://thetfp.com/tfp/tilted-technology/42888-obj-c-not-key-value-coding-compliant-key-nsdevicepath-f-king-docs.html)

juanvaldes 01-25-2004 12:17 AM

[obj-c] not key value coding-compliant for the key NSDevicePath or F#$King Docs!!
 
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. :hmm:

*sigh*
okay I feel better now.

juanvaldes 01-25-2004 12:31 AM

Nevermind! :D

Love you dear :icare:

cheerios 01-25-2004 12:32 AM

:D cheers debugging saves the day again!

"did you check the obvious?"

juanvaldes 01-25-2004 12:40 AM

aka "huh?, what are you doing here?"

then I pick up the book I was to lazy to check.

and if anyone cares:

For some reason I needed to ask for the dictionary with the userInfo: method not object: like with other notifications.:confused:


All times are GMT -8. The time now is 12:44 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37