12 Dec
2008
12 Dec
'08
6:05 a.m.
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