lc3b****@mac*****
lc3b****@mac*****
Fri Dec 29 16:56:59 JST 2006
Hi. (This is my first time on the list so I apologize if I am not following the "standard" way of asking.) For fun I made a RubyCocoa version of the RaiseManager from the Cocoa Programming book (2nd edition). This is different from the one in / Developer/Examples/RubyCocoa/RubyRaiseMan because it uses bindings and also has support for undo. The code (http://blog.vazexqi.com/files/RubyRaiseMan.tgz) works fine with rubycocoa-0.5.0.1 but fails with the rubycocoa-unstable(svn- revision 1312). It builds fine but while trying to insert a new employee I get this error: 2006-12-29 01:34:15.313 RubyRaiseMan[15052] *** NSRunLoop ignoring exception 'NSUndoManager#removeObjectFromEmployeesAtIndex: - Can't get Objective-C method signature for selector 'removeObjectFromEmployeesAtIndex:' of receiver #<OSX::NSUndoManager: 0x2f680e class='NSUndoManager' id=0x16006420>' that raised during posting of delayed perform with target 11fc640 and selector 'invokeWithTarget:' And this is the method that caused the error: [MyDocument.rb: 63-74] def insertObject_inEmployeesAtIndex(person, index) OSX::NSLog("insertObject called") undo_manager = self.undoManager (undo_manager.prepareWithInvocationTarget (self)).removeObjectFromEmployeesAtIndex(index) unless undo_manager.isUndoing? undo_manager.setActionName("Insert Person") end self.startObservingPerson(person) @employees.insert(index, person) end removeObjectFromEmployeesAtIndex has been defined somewhere below that method. If I just do the insert (and also remove) without the registering with NSUndoManager it works. I scanned through the ChangeLog but was not able to determine which change broke the application. Any help would be appreciated. Incidentally, there are other problems with the application with application as well: preferences not updating, crashing on edit but I hope solving the problem with NSUndoManager will yield some insight to them. Thanks. -- Nicholas Chen