Help with MacRuby and NSError** args

H

hengist podd

Hi all,

Wondering how to get an NSError instance back from an ObjC method, in
this case -[QTMovie initWithFile:error:], in MacRuby:

#!/usr/local/bin/macruby

framework 'QTKit'

movie = QTMovie.alloc.initWithFile('/Users/foo/some.mov', error:
WHAT_GOES_HERE)

With RubyCocoa, I get back the method's return value followed by any
return-by-argument values:

#!/usr/bin/ruby

require 'osx/cocoa'
include OSX
OSX.require_framework 'QTKit'

movie, error =
QTMovie.alloc.initWithFile_error('/Users/foo/some.mov')

By comparison, MacRuby only returns a single value so I'm guessing it
must use a different approach, but I don't see any information about
this on the MacRuby wiki.

Any pointers would be much appreciated.

Thanks,

has
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top