Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. - (void)viewDidLoad {
  2. [super viewDidLoad];
  3. // Do any additional setup after loading the view.
  4. self.proArray = [[NSMutableArray alloc]init];
  5.  
  6. GCDVC2* __weak weakSelf = self;
  7.  
  8. self.postGCDBlock = ^{
  9.  
  10. GCDVC2* __strong strongSelf = weakSelf;
  11.  
  12. [strongSelf.proArray removeObject:@"3"];
  13. NSLog(@"%@",strongSelf.proArray);
  14. [strongSelf.activityIndicator stopAnimating];
  15. };
  16.  
  17. self.addObjectsBlock = ^{
  18.  
  19. GCDVC2* __strong strongSelf = weakSelf;
  20.  
  21. [strongSelf.proArray addObject:@"2"];
  22. [NSThread sleepForTimeInterval:10];
  23.  
  24. dispatch_async(dispatch_get_main_queue(),strongSelf.postGCDBlock);
  25. };
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement