From: Allison N. <dem...@ma...> - 2008-05-29 13:59:46
|
Hi Eloy, Yes, I have seen it :-/ My own code uses a standard ruby array as you have suggested, but when it comes back out of the view in outlineView_child_ofItem (where the item is the array in question), when I try to do item[index], my code blows up in the bridge (rbobj_get_ocid: see my original post). Interestingly enough, item.size still works correctly. One things is sure - if I add methods to my array before handing it to the NSOutlineView, when I get it back those methods are no longer available. From that I gather that the object is modified whilst crossing the bridge. Maybe this is a bug, or maybe it's just simply that the RubyCocoa bridge was never intended to support this kind of use. Who knows the bridge well enough to decide? Anyway, as always, thanks for the reply. Alli On Thursday, May 29, 2008, at 02:51PM, "Eloy Duran" <elo...@gm...> wrote: >Hi Allison, > >Have you looked at /Developer/Examples/RubyCocoa/PDFKitViewer ? >It has code for an outline view in MyPDFDocument.rb, > >it does use a NSMutableArray afaik, but it should be ducktypable by now. >So ary.childAtIndex(index) could be written as arr[index]. >So I wouldn't worry about that too much. Also if you send a plain ruby >array through the bridge >it will automatiucally be converted to a NSMutableArray. > >Cheers, >Eloy > |