# Help with MacRuby and NSError\*\* args

**URL:** <https://www.ruby-forum.com/t/help-with-macruby-and-nserror-args/149140>\
**Category:** Ruby\
**Created:** [September 21, 2008, 3:19pm UTC](https://www.ruby-forum.com/t/help-with-macruby-and-nserror-args/149140 "2008-09-21T15:19:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![has](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/da6949/32.png) [@has](https://www.ruby-forum.com/u/has)\
**Post date:** [September 21, 2008, 3:19pm UTC](https://www.ruby-forum.com/t/help-with-macruby-and-nserror-args/149140/1 "2008-09-21T15:19:22Z")

</div>

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
