Last active
July 29, 2016 17:26
-
-
Save mavris/fc9b19d61f497417a027b80fab10f709 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view. | |
self.proArray = [[NSMutableArray alloc]init]; | |
GCDVC2* __weak weakSelf = self; | |
self.postGCDBlock = ^{ | |
[weakSelf.proArray removeObject:@"3"]; | |
NSLog(@"%@",weakSelf.proArray); | |
[weakSelf.activityIndicator stopAnimating]; | |
}; | |
self.addObjectsBlock = ^{ | |
GCDVC2* __strong strongSelf = weakSelf; | |
[strongSelf.proArray addObject:@"2"]; | |
[strongSelf.proArray addObject:@"3"]; | |
[NSThread sleepForTimeInterval:10]; | |
dispatch_async(dispatch_get_main_queue(),strongSelf.postGCDBlock); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment