1 if ([NSThread isMainThread])  
 2 {  
 3     [self.downloadMapBtn setImage:[UIImage imageNamed:@"download_map.png"] forState:UIControlStateNormal];  
 4     [self.downloadMapBtn setNeedsDisplay];  
 5 }  
 6 else  
 7 {  
 8     dispatch_sync(dispatch_get_main_queue(), ^{  
 9         //Update UI in UI thread here  
10         [self.downloadMapBtn setImage:[UIImage imageNamed:@"download_map.png"] forState:UIControlStateNormal];  
11         [self.downloadMapBtn setNeedsDisplay];  
14     });  
15 }

 

相关文章:

  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-19
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案