[MacRuby-devel] objc block and ruby block?

Linan Wang tali.wang at gmail.com
Tue Sep 15 16:28:24 PDT 2009


Hi,
I'm playing with the new block syntax of objc recently. I tried to  
call a ruby block from an objc block-ish methods but failed. The code  
snippet:

@implementation BlockTest
...
-(void)testBlock:(void^(int i))block
{
    block(self.x);
}
...
@end;

MacRuby codes:

b.testBlock do |x|
   puts x
end

Anything wrong with my codes? or it's not supported yet? (if so, any  
plan to do it?)

Best wishes
Linan


More information about the MacRuby-devel mailing list