I am working on an abstraction layer for making calls from JavaScript within a UIWebView into the native part of my application.
To that end I require a generic mechanism which translates a JavaScript function call into a Objective-C message to an object. This does work pretty well already, except for calling methods on Objective-C objects which require Block-Arguments.
How do I invoke such methods in a generic manner without having to pass NULL as block argument. I’d like to pass a generic block which can then iterate over all arguments passed into it (variable arguments).
To rephrase: Is there any way to generically call any methods with Block-Parameters notwithstanding the specific types of those blocks (i.e. differences in signatures) such that I can capture the arguments passed into those blocks when they are subsequently executed?
I haven’t tried exactly what you’re doing, but I think I know enough to say, unfortunately, “no”.
A couple problems are uniting against you here:
va_args.(I hope I’m wrong about this and that someone will correct me, but I’m afraid I’m not.)