dispatch_async(dispatch_get_global_queue(0, 0), ^{
//处理的耗时操作
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:@”http://192.168.1.67:8080/img/luckgo_spxq.png“]];
//通知主线程刷新
dispatch_async(dispatch_get_main_queue(), ^{
UIImage *image = [UIImage imageWithData:data];
CGSize size = image.size;
CGFloat width = size.width;
CGFloat height = size.height;
CGFloat scale = height/width;
CGFloat scaledWidth = SCREEN_WIDTH;
CGFloat scaledHeight = SCREEN_WIDTH * scale;
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 64, scaledWidth, scaledHeight)];
imageView.image = image;
[self.view addSubview:imageView];
});
});