I want to fetch information about the types of the arguments in an instance-method at runtime.
For instance if I have the method:
- (void)doSomethingWithItem:(Item *)item usingName:(id<Type2>)name;
Here I would like to retrieve Item and id<Type2>.
Is there any way of doing this, or is there no type information available for the arguments at runtime?
There is “runtime” method argument type information, which is basically the NSMethodSignature class all about. However, all Objective-C types i.e.
Item*andid<Type2>will be conflated toidwhen compiling, i.e. you can’t distinguish between differentidsubtypes.