I know that objective-c methods are actually c function, and that the first two arguments are self and _cmd. I'm trying to get the remaining arguments as an array (including or excluding, self and _cmd)
For example:
-(void)someMethod:(id)firstArg withObject:(id)secondArg andObject:(id)thirdArg {
//then something like:
args[0] //corresponds to self
args[1] //corresponds to _cmd
args[2] //corresponds to firstArg
args[3] //corresponds to secondArg
args[3] //corresponds to thirdArg
//or just start from firstArg being the 0th item in the index (skipping out self and _cmd)
}
What I'm trying to do is something like:
[self doOtherMethod:@selector(otherMethod:withObject:andObject:) withObjects:args];
So how can I get an array (c array or even NSArray) of the arguments passed to the method, so that I can pass them on or enumerate through them?
EDIT: I want to do this with existing methods, e.g. delegate methods that I can't change.