Invoking an NsBlock
Has anyone had success
invoking an NSBlock? I have a python objc class that i have crated, which is accepting an ObjCBlock as an argument. The Block takes two arguments, and integer and a pointer (to the objc equivalent of a list). (This is the
completionarg of for a PA2ConsoleCompletionProvider )
However, when calling ObjCInstance on the pointer, it returns an NSBlock. This has a method invoke(), but it does not want to take arguments. I feel like I have ben able to do this before, but I have forgotton how!
To be clear -- the block i want to call is one provided to me, not one i created.
I don't know how well the
invokemethod works... I think the proper way to invoke a block is to read it as a structure pointer (see http://clang.llvm.org/docs/Block-ABI-Apple.html for the struct format), take the
invokefunction pointer from there, cast it to the correct signature, and then call that.