[Rubycocoa-devel 286] Re: pass-by-reference arguments support + class hierarchy

Zurück zum Archiv-Index

kimura wataru kimur****@i*****
Fri Jun 9 00:29:28 JST 2006


Hi,

On Mon, 5 Jun 2006 18:17:54 +0200, Laurent Sansonetti wrote:
> Hi all,
> 
> In the unstable branch there are now two interesting features.
> 

> 2/ class hierarchy
> 
> The current version of RubyCocoa does not respect the Objective-C  
> class hierarchy when creating the Ruby proxy classes. For example,  
> OSX::NSString does not inherit from OSX::NSObject.
> 
> I changed the code to respect that hierarchy. So that:
> 
>    tv = NSTableView.alloc.initWithFrame(OSX::NSRect::ZERO)
>    tv.is_a?(NSView) # -> true
> 
> This was a required change for the pass-by-reference support, and it  
> iterates on superclasses to find the registered signatures.
> 
It's cool!

Some classes have prefix '%' or '_'. For example, class hierarchy of
NSURL is like this;

  NSURL < %NSURL < NSObject

So, the return value of `NSURL.superclass' becomes OSX::ObjcID in RubyCocoa. 
I changed oc_import.rb a little and wrote tests. This patch makes that;

  NSURL.superclass # => NSObject (ignore internal class)


-- 
kimura wataru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: skip_internal_class.patch
Type: application/octet-stream
Size: 2525 bytes
Desc: not available
Url : http://lists.sourceforge.jp/mailman/archives/rubycocoa-devel/attachments/20060609/48066fa9/attachment.obj 


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