[you probably should have mentioned that this is an Apple extension to
C as well as Objective C]
this is an interesting extension
=========================
the author has some example code as well
from C Blocks article
by Joachim Bengtsson
"
Variables pointing to blocks take on the exact same syntax as
variables pointing to functions, except * is substituted for ^. For
example, this is a function pointer to a function taking an int and
returning a float:
float (*myfuncptr)(int);
and this is a block pointer to a block taking an int and returning a
float:
float (^myblockptr)(int);
As with function pointers, you'll likely want to typedef those types,
as it can get relatively hairy otherwise. For example, a pointer to a
block returning a block taking a block would be something like void(^)
(void) (^myblockptr)(void(^)()), which is nigh impossible to read (and
doesn't even compile, I'm not sure how that'd be done). A simple
typedef later, and it's much simpler:
typedef void (^Block)();
Block (^myblockptr)(Block);
Declaring blocks themselves is where we get into the unknown, as it
doesn't really look like C, although they resemble function
declarations. Let's start with the basics:
myvar1 = ^ returntype (type arg1, type arg2, and so on) {
block contents;
like in a function;
return returnvalue;
};
This defines a block literal ( from after = to and including } ),
explicitly mentions its return type, an argument list, the block body,
a return statement, and assigns this literal to the variable myvar1.
A literal is a value that can be built at compile-time. An integer
literal (The 3 in int a = 3

and a string literal (The "foobar" in
const char *b = "foobar"

are other examples of literals. The fact
that a block declaration is a literal is important later when we get
into memory management.
Finding a return statement in a block like this is vexing to some.
Does it return from the enclosing function, you may ask? No, it
returns a value that can be used by the caller of the block. See
'Calling blocks'. Note: If the block has multiple return statements,
they must return the same type.
"