[MacRuby-devel] Invoking an obj-c method requiring a block

Laurent Sansonetti laurent.sansonetti at gmail.com
Sun Sep 18 02:15:26 PDT 2011


Hi Andy,

Blocks should work. Perhaps there is a problem with this very specific
API. Could you file a ticket? We will investigate.

Thanks
Laurent

On Sat, Aug 20, 2011 at 11:52 PM, Andy Park <sohocoke at gmail.com> wrote:
> I tried using blocks today, to no avail.
>
> This didn't work:
>                NSNotificationCenter.defaultCenter.addObserverForName "kDocSetSelection
> Changed", object:nil, queue:nil, usingBlock:Proc.new{ |notification|
>                        NSLog("notified")
>                }
>
> But this did:
>                NSNotificationCenter.defaultCenter.addObserver(self, selector: "handleM
> e:", name: "kDocSetSelectionChanged", object: nil)
>
> I found http://www.macruby.org/trac/ticket/760 that hinted MacRuby does impleme
> nt blocks, but also had references to BridgeSupport. I installed the preview-3
> version; what would be the reason the above didn't work?
>
> Thanks.
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>


More information about the MacRuby-devel mailing list