#1196: Trouble with NSBrowser and Core Data --------------------------------+------------------------------------------- Reporter: shobe@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby 0.8 Component: MacRuby | Keywords: NSBrowser, Coredata --------------------------------+------------------------------------------- I am trying to get NSBrowser to work with Core Data. I have tried two very simple implementations, which I can get to work in Cocoa. I am not a programmer by trade, so it is certainly possible that I am the problem. However, I have followed two examples very closely and still get a key value coding error. First I tried the simple example described here: http://www.ars.usda.gov/sp2UserFiles/person/589/CoreDataBrowserDoc.pdf and here: http://lists.apple.com/archives/cocoa-dev/2006/Oct/msg00362.html It works fine in Objective-C/Cocoa, but with MacRuby 0.8 and 0.9 I get the following error when I compile and run: {{{ uncaught Objective-C/C++ exception... 2011-03-15 18:58:32.497 nbtest5[36531:a0f] An uncaught exception was raised 2011-03-15 18:58:32.499 nbtest5[36531:a0f] [<NSApplication 0x20000f480> valueForUndefinedKey:]: this class is not key value coding-compliant for the key managedObjectContext. 2011-03-15 18:58:32.500 nbtest5[36531:a0f] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSApplication 0x20000f480> valueForUndefinedKey:]: this class is not key value coding- compliant for the key managedObjectContext.' *** Call stack at first throw: ( 0 CoreFoundation 0x00007fff8574a7b4 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x00007fff84f0d0f3 objc_exception_throw + 45 2 CoreFoundation 0x00007fff857a2969 -[NSException raise] + 9 3 Foundation 0x00007fff8811fc92 -[NSObject(NSKeyValueCoding) valueForUndefinedKey:] + 245 4 Foundation 0x00007fff8804f5a8 -[NSObject(NSKeyValueCoding) valueForKey:] + 420 5 AppKit 0x00007fff87883384 -[NSApplication(NSScripting) valueForKey:] + 492 6 Foundation 0x00007fff88052eec -[NSObject(NSKeyValueCoding) valueForKeyPath:] + 226 7 AppKit 0x00007fff87618b6f -[NSBinder valueForBinding:resolveMarkersToPlaceholders:] + 171 8 AppKit 0x00007fff876187fc -[NSObjectParameterBinder _updateObject:observedController:observedKeyPath:context:] + 1078 9 AppKit 0x00007fff8760ba33 -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 557 10 AppKit 0x00007fff875e8546 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1172 11 AppKit 0x00007fff875e688d loadNib + 226 12 AppKit 0x00007fff875e5d9a +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 248 13 AppKit 0x00007fff875e5bd2 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 326 14 AppKit 0x00007fff875e3153 NSApplicationMain + 279 15 ??? 0x0000000102d5b99d 0x0 + 4342528413 16 libmacruby.dylib 0x000000010014b8b5 rb_vm_dispatch + 1077 17 ??? 0x0000000102d5ab56 0x0 + 4342524758 18 ??? 0x0000000102d5a4eb 0x0 + 4342523115 19 libmacruby.dylib 0x0000000100164fb3 rb_vm_run + 531 20 libmacruby.dylib 0x0000000100040cd0 ruby_run_node + 80 21 libmacruby.dylib 0x000000010015c1d2 macruby_main + 370 22 nbtest5 0x0000000100000f20 main + 40 23 nbtest5 0x0000000100000ef0 start + 52 24 ??? 0x0000000000000001 0x0 + 1 ) terminate called after throwing an instance of 'NSException' }}} Unfortunately, I have no idea what these errors mean, so I don't really know what steps to take to troubleshoot the problem. It is the fact that both of these simple examples work in Objective-C/Cocoa but not in MacRuby that makes me suspect a problem. I am running OS X 10.6.6 and Xcode 3.2.5. -- Ticket URL: <http://www.macruby.org/trac/ticket/1196> MacRuby <http://macruby.org/>