NSURLConnection leak?

前端 未结 4 1176
再見小時候
再見小時候 2020-12-13 17:06

i have set up a nsurl which grabs the data from http. when i run instrument, it says i have a leak NSFNetwork object.

and how do i release theConnection

4条回答
  •  难免孤独
    2020-12-13 17:42

    Hello have you test this delegate method ?

    - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse
    {
        return nil;
    }
    

    You can manage the cache more precisely.

    "reset" NSURLCache *sharedCache can cause problems on other part of your code ?

提交回复
热议问题