Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Written methods and function blocks not called #39

Open
Morkrom opened this issue Feb 11, 2015 · 1 comment
Open

Written methods and function blocks not called #39

Morkrom opened this issue Feb 11, 2015 · 1 comment

Comments

@Morkrom
Copy link

Morkrom commented Feb 11, 2015

"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.

@Morkrom Morkrom changed the title Written Methods and Function blocks not called Written methods and function blocks not called Feb 11, 2015
@igiu1988
Copy link

igiu1988 commented Aug 15, 2018

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."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants