[MacRuby-devel] [MacRuby] #383: segmentation fault with: NSDictionary.dictionaryWithObjectsAndKeys

MacRuby ruby-noreply at macosforge.org
Wed Oct 14 01:56:00 PDT 2009


#383: segmentation fault with: NSDictionary.dictionaryWithObjectsAndKeys
----------------------------+-----------------------------------------------
 Reporter:  jazzbox@…       |        Owner:  lsansonetti@…        
     Type:  defect          |       Status:  closed               
 Priority:  critical        |    Milestone:  MacRuby 0.5          
Component:  MacRuby         |   Resolution:  invalid              
 Keywords:                  |  
----------------------------+-----------------------------------------------
Changes (by lsansonetti@…):

  * status:  new => closed
  * resolution:  => invalid


Old description:

> {{{
> macruby -e 'p NSDictionary.dictionaryWithObjectsAndKeys("a","b",nil)'
> Segmentation fault
> }}}

New description:

 {{{
 macruby -e 'p NSDictionary.dictionaryWithObjectsAndKeys("a","b",nil)'
 Segmentation fault
 }}}

--

Comment:

 -[NSDictionary dictionaryWithObjectsAndKeys:] is a tricky variadic method
 (it accepts a variable number of arguments). There is no way MacRuby can
 know if a given method is variadic by asking the runtime.

 However, MacRuby can handle these methods if you load the appropriate
 framework metadata first.

 {{{
 $ macruby -e 'framework "Foundation"; p
 NSDictionary.dictionaryWithObjectsAndKeys("a","b",nil)'
 {"b"=>"a"}
 }}}

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/383#comment:1>
MacRuby <http://macruby.org/>



More information about the MacRuby-devel mailing list