gpt4 book ai didi

ios - 为什么不在我的 NSURLProtocol 子类中调用 startLoading?

转载 作者:行者123 更新时间:2023-11-28 22:13:11 25 4
gpt4 key购买 nike

我正在查看 NSURLProtocol 并尝试插入一些 header 。

- (void)startLoading {
NSMutableURLRequest *newRequest = [self.request mutableCopy];
[NSURLProtocol setProperty:@YES forKey:kAccessCodeProtocolKey inRequest:newRequest];
self.connection = [NSURLConnection connectionWithRequest:self.request delegate:self];
}

但我的 startLoading 从未被调用

最佳答案

你实现了 canInitWithRequest: 了吗?它返回 YES 吗?否则,将永远不会调用 startLoading。

关于ios - 为什么不在我的 NSURLProtocol 子类中调用 startLoading?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22388034/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com