-
Notifications
You must be signed in to change notification settings - Fork 34
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
Theos should raise an exception when hooking a non-implemented selector #49
Comments
Logging for this was removed to avoid initializing the class. |
If you mean at runtime, it’s coverec by the previous comment. |
Of course I agree that doing this statically is a non-starter. But, it seems totally doable dynamically and a valuable QoL improvement. I understand the justification to want to avoid the hooking platform initializing a class, but this isn't a serious blocker and can be worked around: Personally, I struggle to think of a bug caused by a class being initialized too early - its dependency chain of other classes should already have been
|
I now see bugs caused by the behavior mentioned in the commit message. I think both approaches above would avoid it. |
It's easy to make a mistake with theos by placing a method-hook under the wrong
%hook
class, or adding a typo to a selector name. In this case, the hooks will silently fail, and the methods will not be swizzled, leading to confusion of whether the target methods are being invoked at all.Instead, theos should loudly fail when I provide an 'invalid hook'. This would catch this bug much earlier in development and reduce headaches.
The text was updated successfully, but these errors were encountered: