Hello,

AFAIK, the method you describe should should work as Monobjc does not
prevent the use of blocks. You just have to be careful about the scope of
the blocks and their lifecycle.

You didn't write what was your problem; does your application crash, or
something else ?

Regards, Laurent Etiemble.

2010/6/9 Oscar Blasco <oblasco...@gmail.com>

>  Hello all,
>
>
>
> I’m currently trying to add a keyboard hooking function using
> NSEvent:addGlobalMonitorForEventsMatchingMask method which needs a block as
> a callback. To be able to define that block I moved that piece of code to a
> native class in a Cocoa  Framework. The framework is wrapped from Monobjc so
> that from Mono the code creates an object of that class an calls a native
> method which then creates and register the block using the above NSEvent
> class method.
>
>
>
> I know the upcoming Monobjc major release will add support for blocks, but
> this is purely native code (involved in defining the block and assigning it
> to the global monitor). Is there any Monobjc/block interaction that forbids
> the use of blocks at all?
>
>
>
> Thanks in advance,
>
>
>
> *Óscar Blasco Maestro
> *Senior Software Developer
> obla...@vsn.es
>
>

Reply via email to