@Retention(value=RUNTIME) @Target(value={PARAMETER,METHOD}) public @interface Block
Runnable, Callable or any of the block
interfaces in the org.robovm.objc.block package. The RoboVM compiler
will generate a Marshaler class which will be used to marshal the
block type.
The interface type can be a generic type such as Callable. The RoboVM
compiler will resolve the actual type arguments from the method parameter or
return type and use these in the Callback method signature. Wrapper
classes for primitive types like Integer will be boxed/unboxed to
their primitive counterpart.
Type modifier annotations such as ByVal and Pointer can be
specified as the value() of the Block annotation. The syntax
is:
RetAnno1 RetAnno2 (ParamAnno1_1 ParamAnno1_2 ..., ParamAnno2_1, ...)Recognized annotations are
ByVal, ByRef, Pointer,
MachineSizedFloat, MachineSizedSInt, MachineSizedUInt
and Block.
Examples:
void (^)(void) => @Block Runnable
void (^)(BOOL) => @Block VoidBooleanBlock
CGRect (^)(long, char) =>
@Block("@ByVal (@MachineSizedSInt,)") Block1<Long, Byte, CGRect>
Copyright © 2012-2015 RoboVM AB. All Rights Reserved.