From: Rupert B. <rup...@li...> - 2005-11-03 21:31:25
|
Hi, I am using today's latest CVS version of RubyCocoa, and trying coredata and kvc_depends_on : great ! I am trying to "translate" the NSPersistentDocumentTutorial into Ruby : http://developer.apple.com/documentation/Cocoa/Conceptual/ NSPersistentDocumentTutorial I have got to chapter 3 (creating the custome Employee class) : this works with Employee.rb, I have even got fullNameAndID working, dynamically computed from firstName and lastName, and displayed in the GUI. However, I do not seem to be able to connect firstName in the GUI with the model in Employee.rb; ditto for lastName. This is my Employee class : class Employee < OSX::NSManagedObject include OSX attr_accessor :firstName attr_accessor :lastName kvc_accessor :lastName, :firstName kvc_depends_on([ :lastName, :firstName], :fullNameAndID) def initialize @firstName = "MyFirst" @lastName = "MyLast" end def fullNameAndID return OSX::NSString.stringWithString(@lastName + ", " + @firstName) end end What am I missing ? Is there something not obvious which should be done, considering that this tutorial uses bindings (of course) ad core data (including a data model with entities) ? Thanks for any help, Rup |