BigBang
BigBang copied to clipboard
It would be better to use class_replaceMethod
https://github.com/codesourse/BigBang/blob/2ca5bcd6fcd9fb2a0dc1d1f7da0f4b8558f00ebf/BigBang/BigBang.m#L86
If the class has overridden the -[WhateverClass forwardInvocation:]
method, then calling the class_addMethod
function will lead to fatal error. However, class_replaceMethod
will act like class_addMethod
if there isn't such -[WhateverClass forwardInvocation:]
method, or replace the method as expected if there is one.