[MacRuby-devel] performSelectorOnMainThread Problem
Alex Greif
alex at greifdesign.net
Mon Oct 10 06:54:58 PDT 2011
The xcode documentation states that if the method
performSelectorOnMainThread has the argument withObject:nil, then the nil
means that the target method takes no arguments.
The following code throws an ArgumentError wrong number of arguments (1
for 0):
def foo
self.performSelectorOnMainThread(:'bar', withObject:nil,
waitUntilDone:true)
end
def bar
# some gui change
end
But it works fine if I add a dummy argument to the bar method and change
the selector to 'bar:' like
def foo
self.performSelectorOnMainThread(:'bar:', withObject:nil,
waitUntilDone:true)
end
def bar(dummy)
# some gui change
end
Is this a bug, or do I really need the dummy argument in the target method?
Thanks,
Alex.
More information about the MacRuby-devel
mailing list