[ https://issues.apache.org/jira/browse/WEEX-548?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16581853#comment-16581853 ]
ASF GitHub Bot commented on WEEX-548: ------------------------------------- cxfeng1 closed pull request #1395: [WEEX-548][iOS] Weex devtool can not debug recycle list URL: https://github.com/apache/incubator-weex/pull/1395 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/ios/playground/Podfile b/ios/playground/Podfile index 77accedfe0..5e4c34c129 100644 --- a/ios/playground/Podfile +++ b/ios/playground/Podfile @@ -4,7 +4,7 @@ platform :ios, '8.0' def common pod 'WeexSDK', :path=>'../../' - pod 'WXDevtool', '0.15.3' + pod 'WXDevtool','0.16.2' pod 'SDWebImage', '3.7.5' pod 'SocketRocket', '0.4.2' pod 'ATSDK-Weex', '0.0.1',:configurations => ['Debug'] diff --git a/ios/playground/WeexDemo/Scanner/WXScannerVC.m b/ios/playground/WeexDemo/Scanner/WXScannerVC.m index 0f0f67846a..01b3262df0 100644 --- a/ios/playground/WeexDemo/Scanner/WXScannerVC.m +++ b/ios/playground/WeexDemo/Scanner/WXScannerVC.m @@ -23,8 +23,7 @@ #import "UIViewController+WXDemoNaviBar.h" #import "WXDemoViewController.h" #import "WXDebugTool.h" - -#import <TBWXDevTool/WXDevTool.h> +#import "WXDevTool.h" #import <AudioToolbox/AudioToolbox.h> @interface WXScannerVC () diff --git a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m index cb4903ace0..e561730a60 100644 --- a/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m +++ b/ios/sdk/WeexSDK/Sources/Bridge/WXBridgeContext.m @@ -797,7 +797,7 @@ - (void)executeJsMethod:(WXCallJSMethod *)method [self performSelector:@selector(_sendQueueLoop) withObject:nil]; } -- (void)callJSMethod:(NSString *)method args:(NSArray *)args onContext:(id<WXBridgeProtocol>)bridge completion:(void (^)(JSValue * value))complection +- (void)callJSMethod:(NSString *)method args:(NSArray *)args onContext:(id<WXBridgeProtocol>)bridge completion:(void (^)(JSValue * value))completion { NSMutableArray *newArg = nil; if (!bridge) { @@ -805,22 +805,23 @@ - (void)callJSMethod:(NSString *)method args:(NSArray *)args onContext:(id<WXBri } if (self.frameworkLoadFinished) { newArg = [args mutableCopy]; - if ([newArg containsObject:complection]) { - [newArg removeObject:complection]; + if ([newArg containsObject:completion]) { + [newArg removeObject:completion]; } WXLogDebug(@"Calling JS... method:%@, args:%@", method, args); - if ([bridge isKindOfClass:[WXJSCoreBridge class]]) { + if (([bridge isKindOfClass:[WXJSCoreBridge class]]) || + ([bridge isKindOfClass:NSClassFromString(@"WXDebugger") ]) ) { JSValue *value = [bridge callJSMethod:method args:args]; - if (complection) { - complection(value); + if (completion) { + completion(value); } } else { [bridge callJSMethod:method args:args]; } } else { newArg = [args mutableCopy]; - if (complection) { - [newArg addObject:complection]; + if (completion) { + [newArg addObject:completion]; } [_methodQueue addObject:@{@"method":method, @"args":[newArg copy]}]; } diff --git a/ios/sdk/WeexSDK/Sources/Component/RecycleList/WXComponent+DataBinding.mm b/ios/sdk/WeexSDK/Sources/Component/RecycleList/WXComponent+DataBinding.mm index 22b39acef8..e29f288c1d 100644 --- a/ios/sdk/WeexSDK/Sources/Component/RecycleList/WXComponent+DataBinding.mm +++ b/ios/sdk/WeexSDK/Sources/Component/RecycleList/WXComponent+DataBinding.mm @@ -105,7 +105,7 @@ - (void)updateBindingData:(NSDictionary *)data __componentId++; dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); [[WXSDKManager bridgeMgr] callComponentHook:self.weexInstance.instanceId componentId:self.attributes[@"@templateId"] type:@"lifecycle" hook:@"create" args:@[self->_virtualComponentId, newData] competion:^(JSValue *value) { - [newData addEntriesFromDictionary:[value toDictionary][@"0"]]; + [newData addEntriesFromDictionary:[value toArray][0]]; [newData setObject:indexPath forKey:@"indexPath"]; [newData setObject:listRef forKey:@"recycleListComponentRef"]; [[recycleListComponent dataManager] updateVirtualComponentData:self->_virtualComponentId data:newData]; diff --git a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m index 91fdd90132..84a35bc1ce 100644 --- a/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m +++ b/ios/sdk/WeexSDK/Sources/Engine/WXSDKEngine.m @@ -356,17 +356,15 @@ + (void)connectDevToolServer:(NSString *)URL + (void)_originalRegisterComponents:(NSDictionary *)components { NSMutableDictionary * mutableComponents = [components mutableCopy]; void (^componentBlock)(id, id, BOOL *) = ^(id mKey, id mObj, BOOL * mStop) { - NSString *name = mObj[@"name"]; NSString *componentClass = mObj[@"clazz"]; NSDictionary *pros = nil; if (mObj[@"pros"]) { - pros = mObj[@""]; + pros = mObj[@"pros"]; } [self registerComponent:name withClass:NSClassFromString(componentClass) withProperties:pros]; }; [mutableComponents enumerateKeysAndObjectsUsingBlock:componentBlock]; - } + (void)_originalRegisterModules:(NSDictionary *)modules { diff --git a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m index 3a9e27e020..00d4f2dd37 100644 --- a/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m +++ b/ios/sdk/WeexSDK/Sources/Manager/WXBridgeManager.m @@ -355,7 +355,7 @@ - (void)fireEvent:(NSString *)instanceId ref:(NSString *)ref type:(NSString *)ty [self callJsMethod:method]; } -- (void)callComponentHook:(NSString*)instanceId componentId:(NSString*)componentId type:(NSString*)type hook:(NSString*)hookPhase args:(NSArray*)args competion:(void (^)(JSValue * value))complection +- (void)callComponentHook:(NSString*)instanceId componentId:(NSString*)componentId type:(NSString*)type hook:(NSString*)hookPhase args:(NSArray*)args competion:(void (^)(JSValue * value))completion { WXPerformBlockOnBridgeThread(^{ if (!type || !instanceId || !hookPhase) { @@ -365,7 +365,7 @@ - (void)callComponentHook:(NSString*)instanceId componentId:(NSString*)component NSArray *newArgs = @[componentId, type, hookPhase, args?:@[]]; WXCallJSMethod * method = [[WXCallJSMethod alloc] initWithModuleName:nil methodName:@"componentHook" arguments:newArgs instance:[WXSDKManager instanceForID:instanceId]]; - [self.bridgeCtx callJSMethod:@"callJS" args:@[instanceId, @[method.callJSTask]] onContext:nil completion:complection]; + [self.bridgeCtx callJSMethod:@"callJS" args:@[instanceId, @[method.callJSTask]] onContext:nil completion:completion]; }); } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Weex devtool can not debug recycle list > ---------------------------------------- > > Key: WEEX-548 > URL: https://issues.apache.org/jira/browse/WEEX-548 > Project: Weex > Issue Type: Bug > Reporter: qz > Assignee: Adam Feng > Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)