[Rubycocoa-devel 199] Re: Single RBObject per Ruby Object

Zurück zum Archiv-Index

kimura wataru kimur****@i*****
Mon Feb 13 01:21:35 JST 2006


Excellent! I'll test this code on my Mac.

Sat, Feb 11, 2006 11:17:15 AM, Jonathan Paisley wrote:
>Hi,
>
>I've been playing with a patch that ensures that RBObject instances  
>created for Ruby objects are unique, rather than creating a new  
>RBObject each time a Ruby object is passed through the bridge.
>
>I had initially hoped this might make it easier to use an  
>NSOutlineView with non-NSObject-derived Ruby objects, but because  
>NSOutlineView doesn't retain the items this doesn't really work.
>

I get it. I met a mysterious behavior of NSOutlineView wwith 
RubyCocoa some years ago, called that to mind.

>In any case, I think it's nice to have a 1-1 mapping between Ruby  
>objects and RBObject. Perhaps it might be worth doing the same for  
>ObjCID instances too (using another hash table to map from 'id' to  
>VALUE).
>
I see. To have not same instance for an object makes pitfalls on 
programming with RubyCocoa. 

>I've included the current patch below. If you think it's worth  
>pursuing further, I'll add test cases etc. If not, I'll keep the  
>patch around in case it becomes useful in the future.
>
>Cheers,
>Jonathan
>
>


-- 
kimura wataru




More information about the Rubycocoa-devel mailing list
Zurück zum Archiv-Index