You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ji...@apache.org on 2017/01/24 08:21:24 UTC
[13/50] [abbrv] incubator-weex git commit: * [ios] fix compiler
complains
* [ios] fix compiler complains
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/9f966590
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/9f966590
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/9f966590
Branch: refs/heads/master
Commit: 9f966590ecc6e72f47784f2e696b479a6fdc361a
Parents: b25b16c
Author: acton393 <zh...@gmail.com>
Authored: Tue Jan 10 22:52:11 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Tue Jan 10 22:52:11 2017 +0800
----------------------------------------------------------------------
ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9f966590/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
index 0220ace..9f18941 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
+++ b/ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
@@ -395,7 +395,7 @@ typedef enum : NSUInteger {
#pragma mark Private Methods
-- (void)_addModuleEventObserversWith:(WXModuleMethod *)method
+- (void)_addModuleEventObserversWithModuleMethod:(WXModuleMethod *)method
{
if ([method.arguments count] < 2) {
WXLogError(@"please check your method parameter!!");
@@ -417,7 +417,7 @@ typedef enum : NSUInteger {
NSMutableDictionary * option = [methodArguments[3] mutableCopy];
[option setObject:method.moduleName forKey:@"moduleName"];
// the value for moduleName in option is for the need of callback
- [self addModuleEventObservers:methodArguments[0] callback:methodArguments[1] option:option moduleClassName:NSClassFromString(moduleClass)];
+ [self addModuleEventObservers:methodArguments[0] callback:methodArguments[1] option:option moduleClassName:NSStringFromClass(moduleClass)];
}
- (void)addModuleEventObservers:(NSString*)event callback:(NSString*)callbackId option:(NSDictionary *)option moduleClassName:(NSString*)moduleClassName
@@ -437,11 +437,13 @@ typedef enum : NSUInteger {
}
}
-- (void)_removeModuleEventObserverWithArguments:(NSArray*)arguments moduleClassName:(NSString*)moduleClassName {
- if (![arguments count] && [arguments[0] isKindOfClass:[NSString class]]) {
+- (void)_removeModuleEventObserverWithModuleMethod:(WXModuleMethod *)method
+{
+ if (![method.arguments count] && [method.arguments[0] isKindOfClass:[NSString class]]) {
return;
}
- [self removeModuleEventObserver:arguments[0] moduleClassName:moduleClassName];
+ Class moduleClass = [WXModuleFactory classWithModuleName:method.moduleName];
+ [self removeModuleEventObserver:method.arguments[0] moduleClassName:NSStringFromClass(moduleClass)];
}
- (void)removeModuleEventObserver:(NSString*)event moduleClassName:(NSString*)moduleClassName
@@ -465,7 +467,7 @@ typedef enum : NSUInteger {
NSDictionary * callbackInfo = listeners[i];
NSString *callbackId = callbackInfo[@"callbackId"];
BOOL once = [callbackInfo[@"once"] boolValue];
- NSMutableDictionary * retData = @{@"type":userInfo[@"eventName"],
+ NSDictionary * retData = @{@"type":userInfo[@"eventName"],
@"module":callbackInfo[@"moduleName"],
@"data":userInfo[@"param"]};
[[WXSDKManager bridgeMgr] callBack:self.instanceId funcId:callbackId params:retData keepAlive:!once];