iOS:optimize API

This commit is contained in:
pengfei.zhou
2020-02-28 17:31:59 +08:00
committed by osborn
parent 7f1b1256ce
commit a2f2e74380
6 changed files with 104 additions and 25 deletions

View File

@@ -62,14 +62,14 @@ - (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message {
if ([cmd compare:@"SWITCH_TO_DEBUG"] == NSOrderedSame) {
[[NSNotificationCenter defaultCenter] postNotificationName:@"EnterDebugEvent" object:nil];
} else if ([cmd compare:@"RELOAD"] == NSOrderedSame) {
// NSString *source = [[dic valueForKey:@"source"] mutableCopy];
// NSString *script = [dic valueForKey:@"script"];
// for (NSValue *value in [[DoricContextManager instance] aliveContexts]) {
// DoricContext *context = value.nonretainedObjectValue;
// if ([source containsString:context.source]) {
// [context reload:script];
// }
// }
NSString *source = [[dic valueForKey:@"source"] mutableCopy];
NSString *script = [dic valueForKey:@"script"];
for (NSValue *value in [[DoricContextManager instance] aliveContexts]) {
DoricContext *context = value.nonretainedObjectValue;
if ([source containsString:context.source]) {
[context reload:script];
}
}
}
}