我正在查看 NSURLProtocol 并尝试插入一些标题。
- (void)startLoading {
NSMutableURLRequest *newRequest = [self.request mutableCopy];
[NSURLProtocol setProperty:@YES forKey:kAccessCodeProtocolKey inRequest:newRequest];
self.connection = [NSURLConnection connectionWithRequest:self.request delegate:self];
}
但我的 startLoading 从未被调用