iphone - iOS 4 GCD questions -
I've seen some presentations of the WWDC 2010 and block and read most of the concurrency documents and Grand Central Dispatch uses blocks with serial lines to about a few questions in a iOS 4 project to me which is a dictionary of Scrolwu and image information - like URLs for images and so on. I want to use GCD and blocks to download images and in my scrollwid so that the main thread is not blocked. I wrote the following code seems to work: (for pictures Ansreepshn * dict) {Preshk_sisnk (image_queue, ^ {NSString * urlString = [dict objectForKey: @ "url"] ; NSURL * url = [NSURL URLWithString: urlString]; NSData * imageData = [[NSData alloc] initWithContentsOfURL: url] UIImage * image = [UIImage imageWithData: imageData]; UIImageView * Start imageView = // see the image; Dispatch_async (dispatch_as_main_queue (), ^ {[self.scrollView addSubview: imageView];}); [image data release];}); } I have two questions: According to concurrency guide, should I hold the var...