From: [] On
Behalf Of Laurent Etiemble
Sent: jueves, 10 de junio de 2010 10:37
Subject: Re: [] Blocks and Monobjc




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 ?


The block is not being called. It may be due to my lack of knowledge on
blocks life cycle after all. I will further investigate this and let you


Thanks for the tip.




2010/6/9 Oscar Blasco < <>>

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 


Reply via email to