NSMutableArray *nums = [NSMutableArray
arrayWithArray:@[@1, @2, @3]];
//the block captures the array
dispatch_async(dispatch_get_global_queue(
QOS_CLASS_DEFAULT, 0), ^{
NSLog(@"Child thread: %@", nums);
});
[nums addObject:@4];
NSLog(@"Main thread: %@", nums);