diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.h b/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.h index 5ab857cc01..8e77636c19 100644 --- a/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.h +++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.h @@ -61,6 +61,8 @@ + (SEL)methodWithComponentName:(NSString *)name withMethod:(NSString *)method isSync:(BOOL *)isSync; ++ (SEL)methodWithComponentName:(NSString *)name withMethod:(NSString *)method; + /** * @abstract Unregister all the components */ diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.m b/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.m index e624806f4b..dca9699d1d 100644 --- a/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.m +++ b/ios/sdk/WeexSDK/Sources/Manager/WXComponentFactory.m @@ -125,6 +125,10 @@ + (NSDictionary *)componentConfigs { return [[self sharedInstance] getComponentConfigs]; } ++ (SEL)methodWithComponentName:(NSString *)name withMethod:(NSString *)method { + return [[self sharedInstance] _methodWithComponetName:name withMethod:method isSync:NULL]; +} + + (SEL)methodWithComponentName:(NSString *)name withMethod:(NSString *)method isSync:(BOOL *)isSync { return [[self sharedInstance] _methodWithComponetName:name withMethod:method isSync:isSync]; @@ -191,9 +195,9 @@ - (SEL)_methodWithComponetName:(NSString *)name withMethod:(NSString *)method is if (config.asyncMethods) { selStr = [config.asyncMethods objectForKey:method]; } - if (!selStr && config.syncMethods) { + if (isSync && !selStr && config.syncMethods) { selStr = [config.syncMethods objectForKey:method]; - if (selStr.length > 0 && isSync) { + if (selStr.length > 0) { *isSync = YES; } }