I want to add scripting support for an Objective-C project using the objc runtime. Now I face the problem, that I don’t have a clue, how I should call an Objective-C method which takes several named arguments.
So for example the following objective-c call
[object foo:bar];
could be called from C with:
objc_msgSend(object, sel_getUid("foo:"), bar);
But how would I do something similar for the method call:
[object foo:var bar:var2 err:errVar];
??
Best Markus
If one of the variables is a
float, you need to use @Ken‘s method, or cheat by a reinterpret-cast:Also, if the selector returns a float, you may need to use
objc_msgSend_fpret, and if it returns a struct you must useobjc_msgSend_stret. If that is a call to superclass you need to useobjc_msgSendSuper2.