diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm index 441a16f419f..e8ad078da5f 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm @@ -686,7 +686,7 @@ NSInvocation *ObjCTurboModule::createMethodInvocation( NSMutableArray *retainedObjectsForInvocation) { const char *moduleName = name_.c_str(); - const id module = instance_; + const NSObject *module = instance_; if (isSync) { TurboModulePerfLogger::syncMethodCallArgConversionStart(moduleName, methodName); @@ -694,12 +694,10 @@ NSInvocation *ObjCTurboModule::createMethodInvocation( TurboModulePerfLogger::asyncMethodCallArgConversionStart(moduleName, methodName); } - NSInvocation *inv = - [NSInvocation invocationWithMethodSignature:[[module class] instanceMethodSignatureForSelector:selector]]; + NSMethodSignature *methodSignature = [module methodSignatureForSelector:selector]; + NSInvocation *inv = [NSInvocation invocationWithMethodSignature:methodSignature]; [inv setSelector:selector]; - NSMethodSignature *methodSignature = [[module class] instanceMethodSignatureForSelector:selector]; - for (size_t i = 0; i < count; i++) { const jsi::Value &arg = args[i]; const std::string objCArgType = [methodSignature getArgumentTypeAtIndex:i + 2];