From: laurent.etiem...@gmail.com [mailto:laurent.etiem...@gmail.com] On
Behalf Of Laurent Etiemble
Sent: jueves, 10 de junio de 2010 10:37
To: users@lists.monobjc.net
Subject: Re: [us...@lists.monobjc.net] Blocks and Monobjc

 

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 ?

 

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
know. 

 

Thanks for the tip.

 

Oscar.

 

2010/6/9 Oscar Blasco < <mailto:oblasco...@gmail.com> 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 
 <mailto:obla...@vsn.es> obla...@vsn.es
 

 

Reply via email to