Projects
Home     Blog     Install     New Ticket     View Tickets     Browse Source

Ticket #131 (new defect)

Opened 2 months ago

Last modified 7 weeks ago

Dictionary arg not accepted

Reported by: francois@… Owned by: lsansonetti@…
Priority: major Milestone: MacRuby 0.4
Component: MacRuby Keywords:
Cc: masterkain@…

Description

The interpreter finds an error here:

@tmp = NSAttributedString.alloc.initWithData(data, options:NSCharacterEncodingDocumentOption, documentAttributes:0, error:outError);

/Users/francois/Documents/Essais_xcode_et_Ruby/temp3R/build/Debug/temp3R.app/Contents/Resources/MyDocInRuby.rb:46:in initWithData:options:documentAttributes:error:': can't convert Ruby object 0' to Objective-C value of type `@' (ArgumentError)

The problem seems to be in the documentAttributes argument; you can pass 0, an NSDictionary, or a Hash, nothing works. Cocoa expects a value of type NSDictionary** for this argument.

Change History

Changed 2 months ago by lsansonetti@…

So, NSDictionary** means that this argument is returned by reference. Currently this is not implemented in MacRuby, so I will keep this ticket open until it's fixed.

In the meantime you can pass "nil", which is the Objective-C nil equivalent (so, C's NULL). Passing 0 will not work, because 0 in Ruby is a fixnum (numeric) object.

Changed 7 weeks ago by masterkain@…

Changed 7 weeks ago by masterkain@…

  • cc masterkain@… added

Cc Me!

Note: See TracTickets for help on using tickets.