steipete/Aspects

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

coooliang opened this issue · 1 comments

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

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!