[Rubycocoa-devel 595] Re: [Rubycocoa-talk] [ANN] RubyCocoa 0.10.0 Developer Preview

Back to archive index

jeanp****@gmail***** jeanp****@gmail*****
Tue Jan 9 09:37:47 JST 2007


On 1/8/07, Laurent Sansonetti <laure****@gmail*****> wrote:
>
> Hi Jim,
>
> On 1/8/07, Jim Getzen <getze****@comca*****> wrote:
> > Wow, #obj_send and #obj_export look very cool. RubyCocoa is
> > definitely evolving and maturing. Thanks to all the RubyCocoa devs
> > for their hard work.


this is good stuff. i gave it a try and try and got it mostly working. two
things i ran into: should objc_send work even when the method doesn't take
any args and is the sugary '._' working? i'm running rev 1384.

# make a ruby defined method accessible in the objc runtime
class OSX::NSObject
  def mySuperMethod
    puts 'foo'
  end
  objc_export :mySuperMethod, ['id']
end

obj = OSX::NSObject.alloc.init

obj.mySuperMethod
# => foo
obj.performSelector :mySuperMethod
# => foo
obj.objc_send :mySuperMethod
# => Can't get Objective-C method signature for selector 'mySuperMethod:'
obj._ :mySuperMethod
# => Can't get Objective-C method signature for selector '_'

cheers,
jean-pierre
-------------- next part --------------
An HTML attachment was scrubbed...
Download 


More information about the Rubycocoa-devel mailing list
Back to archive index