[MacRuby-devel] [macruby] #97: A selector cannot be nil

macruby ruby-noreply at macosforge.org
Tue Jul 8 15:22:10 PDT 2008


#97: A selector cannot be nil
----------------------------------------+-----------------------------------
 Reporter:  vincent.isambart at gmail.com  |       Owner:  lsansonetti at apple.com
     Type:  defect                      |      Status:  new                  
 Priority:  blocker                     |   Milestone:                       
Component:  MacRuby                     |    Keywords:                       
----------------------------------------+-----------------------------------
 In Objectve-C a selector can be nil, for example the following code is
 correct:
 {{{
 NSMenuItem *dummyItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil
 keyEquivalent:@""];
 }}}
 but in MacRuby we get an error:
 {{{
 % macruby -e "framework 'Cocoa'; NSMenuItem.alloc.initWithTitle('',
 action:nil, keyEquivalent:'')"
 -e:1:in `initWithTitle:action:keyEquivalent:': can't convert Ruby object
 `nil' to Objective-C value of type `:' (ArgumentError)
      from -e:1:in `<main>'
 }}}
 So I think MacRuby should support conversion from nil for selectors.

-- 
Ticket URL: <https://www.macruby.org/trac/ticket/97>
macruby <http://macruby.org/>


More information about the MacRuby-devel mailing list