Projects
Home     Blog     Install     New Ticket     View Tickets     Browse Source

Ticket #107 (closed defect: fixed)

Opened 4 months ago

Last modified 4 months ago

array arguments raise ArgumentError

Reported by: toast@… Owned by: lsansonetti@…
Priority: major Milestone: MacRuby 0.3
Component: MacRuby Keywords:
Cc:

Description

In RubyCocoa I could do this:

cgcolor = CGColorCreate(colorspace,[1.0,1.0,1.0,1.0])

But the same thing in MacRuby gives me this error:

ArgumentError: can't convert Ruby object [1.0, 1.0, 0.0, 1.0]' to Objective-C value of type ^f'

Change History

Changed 4 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.3

Fixed in trunk/r471.

$ cat /tmp/t.rb 
framework 'Cocoa'
colorspace = CGColorSpaceCreateWithName(KCGColorSpaceGenericRGB)
color = CGColorCreate(colorspace,[0.123,0.456,0.789,0.0])
buf = CGColorGetComponents(color)
p buf[0]
p buf[1]
p buf[2]
p buf[3]

$ macruby /tmp/t.rb 
0.123000003397465
0.456000000238419
0.788999974727631
0.0
Note: See TracTickets for help on using tickets.