[MacRuby-devel] I tried converting a working script rubycocoa script to macruby and it failed on this line...

Vincent Isambart vincent.isambart at gmail.com
Thu Dec 11 22:05:18 PST 2008


Hi,

>     NSDistributedNotificationCenter.defaultCenter.addObserver self,
> selector: :next_number, name: "next number", object: "com.imasender" #But
> gives the error below when converted to MacRuby grammer and run with
> macruby.
>
> It's driving me crazy. If the statement is a correct translation from
> RubyCocoa to MacRuby syntax why am I getting a "unrecognized selector sent
> to..." error?

I think your selector should not be :next_number but 'next_number:'
(note the ':' at the end). Every method that has a parameter should
have its selector ending with a ':' in MacRuby.

Cheers,
Vincent


More information about the MacRuby-devel mailing list