开发者

NSMutableURLRequest: didReceiveData not called at the first time

开发者 https://www.devze.com 2022-12-20 08:55 出处:网络
I\'ve dug through a lot of topi开发者_高级运维cs regarding didReceiveData: method not being called - the solution is to set appropriate cachePolicy and implement willCacheResponse delegate method.

I've dug through a lot of topi开发者_高级运维cs regarding didReceiveData: method not being called - the solution is to set appropriate cachePolicy and implement willCacheResponse delegate method.

So I did, now I get didReceiveData message each time anything comes from the server. Unfortunately I don't get didReceiveData the very first time the server responds.

In other words, the first time I get "didReceiveData" message there are 2 response objects in the "data" parameter. Every response from the server following that moment is OK.

Any help?


Just needed a clarification; Are you using any threading in your application?

If Yes, then the thread which creates the connection should receive the response from the server. The other threads will not identify the response which is returned for some other thread.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号