What I need is to declate a C function that takes in both an Objective-C ‘id’ type and ‘Class’ types as a parameter, but nothing else.
Consider:
void the_function(classorid theargument);
I thought of declaring a typedef to achieve this purpose… something that could either hold an ‘id’ pointer or a ‘Class’ value… I would then figure out what value was what with my C function.
So… is there any way (or type?) I can use that lets me achieve this goal?
Thanks. 🙂
Since classes are themselves represented by objects in ObjC, and
idis the “generic object” type, you can in fact useidas the type for a pointer to a class. Defining your function with anidparameter will allow you to pass in both instances andClassobjects. What you do with them inside the function (how you’re going to distinguish them) is your business.