Projects

Ticket #383 (closed defect: invalid)

Opened 2 years ago

Last modified 2 years ago

segmentation fault with: NSDictionary.dictionaryWithObjectsAndKeys

Reported by: jazzbox@… Owned by: lsansonetti@…
Priority: critical Milestone: MacRuby 0.5
Component: MacRuby Keywords:
Cc:

Description (last modified by lsansonetti@…) (diff)

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

Change History

Changed 2 years ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to invalid
  • description modified (diff)

-[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"}
Note: See TracTickets for help on using tickets.