Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 01-25-2004, 12:17 AM   #1 (permalink)
Banned
 
Location: shittown, CA
[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.

*sigh*
okay I feel better now.
juanvaldes is offline  
Old 01-25-2004, 12:31 AM   #2 (permalink)
Banned
 
Location: shittown, CA
Nevermind!

Love you dear
juanvaldes is offline  
Old 01-25-2004, 12:32 AM   #3 (permalink)
Banned
 
Location: 'bout 2 feet from my iMac
cheers debugging saves the day again!

"did you check the obvious?"
cheerios is offline  
Old 01-25-2004, 12:40 AM   #4 (permalink)
Banned
 
Location: shittown, CA
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.
juanvaldes is offline  
 

Tags
codingcompliant, docs, f#$king, key, nsdevicepath, objc


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 10:32 AM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, 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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62