Skip to content

Instantly share code, notes, and snippets.

@mavris
Last active July 29, 2016 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mavris/37763608bb363e55d04157976b51832f to your computer and use it in GitHub Desktop.
Save mavris/37763608bb363e55d04157976b51832f to your computer and use it in GitHub Desktop.
- (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 = ^{
[weakSelf.proArray addObject:@"2"];
[weakSelf.proArray addObject:@"3"];
[NSThread sleepForTimeInterval:10];
dispatch_async(dispatch_get_main_queue(),weakSelf.postGCDBlock);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment