With instruments i got a memory leak on this piece of code and i don\'t understand why!
-(void)goToThisUrl:(id) targetUrl
{
NSAutoreleasePool *pool = [[NSAut
-
First off, you can't allocate a UIImage in a second thread. Uses of UIKit need to be on the main thread. I assume what you wanted to do by creating another thread was to invoke dataWithContentsOfURL without blocking the main thread. But, this is not the right approach. Instead, use a NSURLConnection with an async callback that gets invoked when the download is done. Apple already provides a built-in "download" thread that NSURLConnection uses behind the scenes. So, your approach of creating another thread to download is pointless.
- 热议问题