0

I'm trying to call and objective-c method from a MacRuby application and it works fine as long as I only have one variable in the method. If I add a second variable I get a NoMethodError.

I have a feeling this is something small, but I can't seem to figure it out.

This is the method that works:

- (int)testMethod:(int) x

and this is the one that doesn't:

- (int)testMethod:(int) x secondVariable:(int)y

When I call the first method through the MacRuby testClass.testMethod(1) everything works well but when I call the second I get: in test_command': undefined methodtestMethod' for :testClass (NoMethodError)

4

1 回答 1

0

The syntax for the second method in latest MacRuby should be the following:

testClass.testMethod(x, secondVariable:y)
于 2013-04-05T11:35:36.393 回答