You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, I've hooked the instance method of class A.
Then I try to hook another class method of class A, this class method will be invalid.
I've reviewed the code and find the issue here.
*_aspect_modifySwizzledClasses(^(NSMutableSet swizzledClasses) {
if (![swizzledClasses containsObject:className]) {
aspect_swizzleForwardInvocation(klass);
[swizzledClasses addObject:className];
}
});
The names of class and metaclass are the same. So the aspect_swizzleForwardInvocation of metaclass hook won't be invoke....
Easy to fix this.
Add following code before aspect_modifySwizzledClasses.
if (class_isMetaClass(klass)) {
className = [NSString stringWithFormat:@"meta%@", className];
}
The text was updated successfully, but these errors were encountered:
For example, I've hooked the instance method of class A.
Then I try to hook another class method of class A, this class method will be invalid.
I've reviewed the code and find the issue here.
*_aspect_modifySwizzledClasses(^(NSMutableSet swizzledClasses) {
if (![swizzledClasses containsObject:className]) {
aspect_swizzleForwardInvocation(klass);
[swizzledClasses addObject:className];
}
});
The names of class and metaclass are the same. So the aspect_swizzleForwardInvocation of metaclass hook won't be invoke....
Easy to fix this.
Add following code before aspect_modifySwizzledClasses.
if (class_isMetaClass(klass)) {
className = [NSString stringWithFormat:@"meta%@", className];
}
The text was updated successfully, but these errors were encountered: