On Sep 26, 2008, at 8:52 AM, Brad Wilson wrote:
On 26/09/2008, at 10:32 PM, Richard Kilmer wrote:
On Sep 26, 2008, at 3:17 AM, Brad Wilson wrote:
Brad,
Try this:
def initialize @employees = [] end
I found this in the Indexed Accessor Patters for To-Map Properties section of the KVC programming guide:
http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Con... /apple_ref/doc/uid/20002174-BAJEAIEE
Ok that makes sense. I'll try it out. Thanks!
I don't entirely understand KVC yet, and from what I understood the standard ruby attr_accessor would be enough to handle it. I'll try adding the extra methods.
I think it depends on the way in which the key is being accessed. Sounds like the key you are accessing is being accessed as a collection (thus the need for these methods). If it was a simple property: attr_accessor :employees Would have been sufficient -rich
Brad _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel