Open Morkrom opened 9 years ago
I have the same question. I aspect tableView:didSelectRowAtIndexPath:
[self aspect_hookSelector:@selector(tableView:didSelectRowAtIndexPath:) withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> info, UITableView *tableView, NSIndexPath *indexPath) {.....
when code run into invokeWithInfo
, it happens "blockSignature's numberOfArguments being larger than the methodSignature."
"aspect_hook" blocks are not being called for me for methods (or dynamic swift functions). If I use a comparable implementation such as this, it works for public methods as expected.
It seems the issue lies partly in the aspect_isCompatibleBlockSignature function... if the method being intercepted is a dynamic swift function, there is a mismatch around line 210 in .m:
if (signaturesMatch) { For loop, the condition for signaturesMatch = NO is not compatible with a dynamic Swift function. }
commenting out this loop allows a dynamic Swift function to work correctly.
If it is an objective-C method, the mismatch occurs due to the blockSignature's numberOfArguments being larger than the methodSignature.
I am still trying to figure out what all this means, and if I do I will attempt a solution. Otherwise some help would be great because I really want to use it.