[MacRuby-devel] NSArrayController

Laurent Sansonetti lsansonetti at apple.com
Thu Sep 25 19:40:15 PDT 2008


Hi Brad,

On Sep 25, 2008, at 6:29 PM, Brad Wilson wrote:

> Hi,
>
> Is it possible to use bind values using macruby?
>
> I've been working through Hillegass' Cocoa Programming For Mac OS X,  
> converting the exercises to MacRuby.
>
> I've hit a big of a snag in the RaiseMan exercise though. It uses an  
> NSArrayController as a binding for a table view. There is then a  
> NSDocument called Person which is bound to provide the values for  
> the table.
>
> When I try to run this, I'm getting an error:
> this class is not key value coding-compliant for the key employees
>
> I've tried a number of different ways to make employees respond:
> attr_accessor :employees
> and also using a manual setter (in two different ways):
> def employee=(val) end
> def setEmployee(val) end
>
>
> Neither seem to work.  Am I doing something wrong? Is this  
> unimplemented?

I never really tried to use NSArrayController in MacRuby, but I know  
that Rich uses it in HotCocoa and it seems to work well. And it's  
certainly possible to use bindings in MacRuby.

Could you upload your code somewhere so that we can have a look at it?

Also, it's great that you're converting the book exercises to MacRuby.  
If you are willing to contribute them after, I would be glad to  
package them in the distribution :-)

Laurent


More information about the MacRuby-devel mailing list