标签:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ //耗时的操作 NSURL *url = [NSURL URLWithString:@""]; NSData *data = [[[NSData alloc] initWithContentsOfURL:url autorelease]; UIImage *image = [[[UIImage alloc] initWithData:data] autorelease]; dispatch_async(dispatch_get_main_queue(),^{ //更新界面 _imageView.image = image; }); });
标签:
原文地址:http://www.cnblogs.com/SimonGao/p/5070980.html