I am new to plugin development w/DVDPedia (not to Cocoa dev) and am trying to understand how things work. I am using the beta version of DVDPedia mentioned in this forum, although the same problem occurs with the current release version.
I am trying to change just one field in (for now) a single selected entry. Here is my code:
Code: Select all
- (NSArray *)menuCommandFor:(NSMutableArray *)entries {
NSLog(@"[[entries objectAtIndex:0] valueForKey:@\"custom1\"] is: %@ (%@)", [[entries objectAtIndex:0] valueForKey:@"custom1"], [[[entries objectAtIndex:0] valueForKey:@"custom1"] class]);
[[entries objectAtIndex:0] setValue:@"99.3" forKey:@"custom1"];
return [NSArray arrayWithObject:[NSNumber numberWithBool:YES]];
}
Code: Select all
10/9/09 8:46:55 AM DVDpedia[1621] [[entries objectAtIndex:0] valueForKey:@"custom1"] is: 99.5 (NSCFString)
10/9/09 8:46:55 AM DVDpedia[1621] [<NSCFBoolean 0xa02f2400> valueForUndefinedKey:]: this class is not key value coding-compliant for the key title.
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] NSExceptionHandlerExceptionRaiser (in ExceptionHandling) + 185
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] objc_exception_throw (in libobjc.A.dylib) + 40
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] -[NSException raise] (in CoreFoundation) + 17
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] (in Foundation) + 259
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] _NSGetUsingKeyValueGetter (in Foundation) + 123
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] -[NSObject(NSKeyValueCoding) valueForKey:] (in Foundation) + 250
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] -[MyPanel setFromDictionary:] (in Pediabase) + 49
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] -[MyControllerShared addEntriesToPanel:] (in Pediabase) + 63
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] -[NSApplication sendAction:to:from:] (in AppKit) + 112
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] -[NSMenu performActionForItemAtIndex:] (in AppKit) + 493
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] (in AppKit) + 220
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] AppKitMenuEventHandler (in AppKit) + 6608
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) (in HIToolbox) + 1181
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) (in HIToolbox) + 405
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] SendEventToEventTarget (in HIToolbox) + 52
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] SendHICommandEvent(unsigned long, HICommand const*, unsigned long, unsigned long, unsigned char, OpaqueEventTargetRef*, OpaqueEventTargetRef*, OpaqueEventRef**) (in HIToolbox) + 411
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] SendMenuCommandWithContextAndModifiers (in HIToolbox) + 59
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] SendMenuItemSelectedEvent (in HIToolbox) + 134
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] FinishMenuSelection(MenuData*, MenuData*, MenuResult*, MenuResult*, unsigned long, unsigned long, unsigned long, unsigned char) (in HIToolbox) + 162
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] MenuSelectCore(MenuData*, Point, double, unsigned long, OpaqueMenuRef**, unsigned short*) (in HIToolbox) + 640
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] _HandleMenuSelection2 (in HIToolbox) + 383
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] _HandleMenuSelection (in HIToolbox) + 53
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] _NSHandleCarbonMenuEvent (in AppKit) + 244
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] _DPSNextEvent (in AppKit) + 1918
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit) + 128
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] -[NSApplication run] (in AppKit) + 795
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] NSApplicationMain (in AppKit) + 574
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] _start (in DVDpedia) + 209
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] start (in DVDpedia) + 41
10/9/09 8:46:56 AM [0x0-0x89089].com.bruji.dvdpedia[1621] 0x2
Can anyone help me to understand why I am tickling the exception?
Thanks,
Martin