Tilted Forum Project - TFP - Sexuality, Philosophy and Political Discussion

Go Back   Tilted Forum Project - TFP - Sexuality, Philosophy and Political Discussion > Interests > Tilted Technology

Reply
 
LinkBack Thread Tools
Old 01-25-2004, 01:17 AM   #1 (permalink)
Banned
 
Join Date: Apr 2003
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   Reply With Quote
Old 01-25-2004, 01:31 AM   #2 (permalink)
Banned
 
Join Date: Apr 2003
Location: shittown, CA
Nevermind!

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

"did you check the obvious?"
cheerios is offline   Reply With Quote
Old 01-25-2004, 01:40 AM   #4 (permalink)
Banned
 
Join Date: Apr 2003
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   Reply With Quote
Reply

Bookmarks

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

Thread Tools

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
Forum Jump


All times are GMT -7. The time now is 04:24 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
All text (c) 2002-2008 Tilted Forum Project
"Insignia" vBulletin 3.5 - b6gm6n - x7x7x7.com