清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
@property (nonatomic,strong) UIButton *btnOne;
__block typeof (_btnOne) one = _btnOne;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSURL *url = [NSURL URLWithString:@"http://easyread.ph.126.net/G8GtEi-zmPQzvS5w7ScxmQ==/7806606224489671909.jpg"];
NSData *data = [NSData dataWithContentsOfURL:url];
if (data != nil) {
dispatch_async(dispatch_get_main_queue(), ^{
UIImage *image = [UIImage imageWithData:data];
[one setBackgroundImage:image forState:UIControlStateNormal];
});
}
});