我正在使用imp_implementationForwardingToSelector库将 IMP 转发到不同的选择器。它在真实设备上运行良好,但在我尝试为模拟器构建时出错
错误:架构 x86_64 的未定义符号
SEL forwardingSelector = NSSelectorFromString([NSString stringWithFormat:@"__supert__forwarding__%@__%@", className, methodName]);
SEL originalSelector = NSSelectorFromString(originalSelectorString);
IMP forwardingImplementation = imp_implementationForwardingToSelector(forwardingSelector, methodReturnsStructValue);
class_replaceMethod(class, originalSelector, method_getImplementation(method), typeEncoding);
method_setImplementation(method, forwardingImplementation);
是否有任何我遗漏的设置或任何其他 lib 建议可以帮助我做同样的事情。