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

Error: viewDidLoad already hooked in TestViewController. A method can only be hooked once per class hierarchy. #180

Open
coooliang opened this issue May 25, 2023 · 1 comment

Comments

@coooliang
Copy link

coooliang commented May 25, 2023

@interface TestViewController : UIViewController

@interface ViewController : UIViewController

 Class class = NSClassFromString(@"TestViewController");
[class aspect_hookSelector:@"viewDidLoad" withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> aspectInfo) {
           
} error:nil];

Class class = NSClassFromString(@"ViewController");
[class aspect_hookSelector:@"viewDidLoad" withOptions:AspectPositionAfter usingBlock:^(id<AspectInfo> aspectInfo) {
           
} error:nil];

error:
Aspects: Error: viewDidLoad already hooked in TestViewController. A method can only be hooked once per class hierarchy.

@Frizlab
Copy link

Frizlab commented May 25, 2023

Ha! So this is a bit of a shameless plug, but my eXtenderZ lib does not have this limitation.
Sadly I cannot recommend it as-is: it works perfectly but has close to no documentation… and my company is currently not interested in allocating me time to make the doc.

If you’re adventurous and want to use it anyway I’d be happy to help get you started!

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