Giter Club home page Giter Club logo

Comments (8)

casatwy avatar casatwy commented on August 17, 2024

from ctmediator.

bingFly avatar bingFly commented on August 17, 2024

源码里面- (id)performTarget:(NSString *)targetName action:(NSString *)actionName params:(NSDictionary *)params shouldCacheTarget:(BOOL)shouldCacheTarget
这个是没有block的,所以回调不了

from ctmediator.

casatwy avatar casatwy commented on August 17, 2024

from ctmediator.

bingFly avatar bingFly commented on August 17, 2024

你指的是这段代码么?
id result = [self performTarget:url.host action:actionName params:params shouldCacheTarget:NO];
if (completion) {
if (result) {
completion(@{@"result":result});
} else {
completion(nil);
}
}
return result;

还是在params:params这个params里面塞一个block参数?
这个params是url里面的参数,没有办法塞block的
麻烦你了

from ctmediator.

casatwy avatar casatwy commented on August 17, 2024

from ctmediator.

bingFly avatar bingFly commented on August 17, 2024

是这样的,demo里确实有通过方法调用有block回调的。现在我是在你的基础上统一通过url方式调用本地组件。所以才有了这个问题。现在通过url方式是没有异步执行的。是这个问题。url方式也是可以通过paras去传递block的。
if (completion) {
params[@"actionDefaultBlock"] = completion;
}
id result = [self performModule:url.host action:actionName params:params shouldCacheModule:NO];
我在这里默认加了一个block,也是通过para传递的。

from ctmediator.

casatwy avatar casatwy commented on August 17, 2024

可以这么做的

from ctmediator.

casatwy avatar casatwy commented on August 17, 2024

我前面看错了。

你要用URL去做本地跳转?😂

我文章里面已经说得很清楚了,不要这么做。。。

from ctmediator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.