我正在尝试为youtube网址http://www.youtube.com/watch?v=H8SPr6eIVKE下载HTML 这是我的代码......
url = @"http://www.youtube.com/watch?v=H8SPr6eIVKE";
NSMutableURLRequest * request = [[NSMutableURLRequest alloc] initWithURL:url];
[request setValue:(NSString *)kUserAgent forHTTPHeaderField:@"User-Agent"];
[NSURLConnection sendAsynchronousRequest:request
queue:[NSOperationQueue currentQueue]
completionHandler:
^(NSURLResponse *res, NSData *data, NSError *err) {
//My code goes here
});
}];
问题是,这个NSData正在泄漏内存。这很有效如果我尝试下载图像,但如果我尝试下载HTML数据,则会发生某种泄漏。以下是泄漏的更多信息。
1 CoreFoundation __CFDataGrow 2 CoreFoundation CFDataReplaceBytes 3 CoreFoundation CFDataAppendBytes 4 CFNetwork gzipDecodeData(z_stream_s,unsigned char,__ CFAllocator const,__ CFData const *,int) 5 CFNetwork GZipDataDecoder :: decodeData(CFAllocator const,__ CFData const,unsigned char) 6 CFNetwork HTTPProtocol :: decodingDecoding(unsigned char,unsigned char const,lon
所以朋友们有什么线索?我正在尝试播放没有UIWebView的YouTube视频...(不知道苹果是否会批准)