From: kimura w. <ki...@us...> - 2005-11-11 16:01:31
|
Hi, Thu, 10 Nov 2005 18:28:55 -0700, Rod Schmidt wrote: >I have some questions about RubyCocoa's support for key value coding >and the new kvc_accessor and kvc_depends_on methods. > >First off, in Objective-C, all objects are already KVC compliant as >long as you follow certain naming conventions. So why do we have a >separate kvc_accessor method instead of just modifiying attr_accessor >to support key value coding? Is it because attr_accessor is built >into Ruby and we needed a different name? > There is only one difference about style of setter methods in a ruby script. We have to write like this with attr_accesor: obj.setValue_forKey(value, "aKey") We can write like this with kvc_accessor: obj.aKey = value When a ruby script do not use setter methods (ex. access from only Cocoa objects), kvc_accessor equals to attr_accessor. -- kimura wataru |