[MacRuby-devel] Out parameters with MacRuby
lsansonetti at apple.com
Sun Apr 26 19:14:15 PDT 2009
On Apr 26, 2009, at 6:20 PM, Alex Vollmer wrote:
> On Apr 26, 2009, at Apr 26, 10:09 AM, rebotfc wrote:
>> errorp = Pointer.new_with_type("@")
>> result = NSXMLDocument.alloc.initWithData(data,
>> options:NSXMLDocumentValidate, error:errorp)
>> # access error
> Ah cool. Thanks for the response. Is there any documentation on the
> possible values you can hand to the "new_with_type" method? What
> does that '@' sign mean?
In the case of a C structure, you can call the #type class method on
the struct class.
irb(main):001:0> framework 'Foundation'
The next version of MacRuby will have a better Pointer class which
will accept symbols like :int, :object, etc., but in the meantime you
need to pass the Objective-C types.
More information about the MacRuby-devel