Skip to content

Instantly share code, notes, and snippets.

@mavris
Created July 29, 2016 13:51
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/f78db51599a72f55357dedf98a7ad396 to your computer and use it in GitHub Desktop.
Save mavris/f78db51599a72f55357dedf98a7ad396 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 = ^{
GCDVC2* __strong strongSelf = weakSelf;
[strongSelf.proArray removeObject:@"3"];
NSLog(@"%@",strongSelf.proArray);
[strongSelf.activityIndicator stopAnimating];
};
self.addObjectsBlock = ^{
GCDVC2* __strong strongSelf = weakSelf;
[strongSelf.proArray addObject:@"2"];
[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