Starting to learn about core data and dispatch_async. There is a block of code to get url of image from set of data and set it to model of core data like below
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
NSString *urlString = [[[photoDictionary valueForKey:@"images"] objectAtIndex:0] valueForKey:@"url"];
NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]];
dispatch_async(dispatch_get_main_queue(), ^{
[photoModel setValue:imageData forKey:@"photoImageData"];
Can somebody explain to me why we use dispatch_get_global_queue
for the outer dispatch_async and dispatch_get_main_queue
for inner dispatch_async.