Skip to content
This repository was archived by the owner on Dec 27, 2025. It is now read-only.

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

@coooliang

Description

@coooliang
@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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions