cell.myimage.layer.masksToBounds=YES;
cell.myimage.layer.cornerRadius=cell.myimage.frame.size.width/2;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSURL *url=[NSURL URLWithString:cellInfo.image];
NSData *data=[[NSData alloc]initWithContentsOfURL:url];
UIImage *iamge=[[UIImage alloc]initWithData:data];
if (data!=nil) {
dispatch_async(dispatch_get_main_queue(), ^{
[cell.myimage setBackgroundImage:iamge forState:UIControlStateNormal];
});
}
});
时间: 2024-10-07 00:24:29