Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

我想触发requestWillStart方法,requestAccessories、addAccessory如何使用? #526

Open
4 tasks done
suGaoFei opened this issue Aug 24, 2020 · 2 comments
Open
4 tasks done

Comments

@suGaoFei
Copy link

suGaoFei commented Aug 24, 2020

提出问题前请先确认完成了下列几项步骤 New Issue Checklist

  • 我已经阅读过 贡献指南 I have read and understood the CONTRIBUTING guide
  • 我已经阅读过 程序文档 I have read the Documentation
  • 我已经证实这个问题来源于 YTKNetwork 本身,而不是其所依赖的 AFNetworking I have confirmed that this issue is caused by YTKNetwork, not AFNetworking
  • 我已经在项目的 问题列表 中搜索过并且没有找到类似问题 I have searched for a similar issue in the project and found none

问题描述 Issue Description

请给出所提出问题的详尽描述,包括具体的错误信息,打印的堆栈等等,以及重现此问题的具体步骤。

Please fill in the detailed description of the issue (full output of any stack trace, compiler error, ...) and the steps to reproduce the issue.

@suGaoFei
Copy link
Author

我想使用:

    • (void)requestWillStart:(id)request;
    • (void)requestWillStop:(id)request;
      两个方法,子类继承YTKRequest后,重写了这两个方法,但是调用接口:
      startWithCompletionBlockWithSuccess方式并不会走进上述方法。
      我断点发现需要:
  • (void)toggleAccessoriesWillStartCallBack {
    for (id accessory in self.requestAccessories) {
    if ([accessory respondsToSelector:@selector(requestWillStart:)]) {
    [accessory requestWillStart:self];
    }
    }
    }
    所以,如何使用
    @Property (nonatomic, strong, nullable) NSMutableArray<id> *requestAccessories;
    这个属性,
    或者如何调用该方法:
  • (void)addAccessory:(id)accessory;

@suGaoFei
Copy link
Author

[self addAccessory:self];
解决问题了。
=。=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant