Slide 22
Slide 22 text
NSLog(@“Before”);
!
dispatch_async(dispatch_get_global_queue(
DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
//Background Task
for (int i = 1; i < 100000; i++) {
NSLog(@“%l”, i);
}
!
dispatch_async(dispatch_get_main_queue(),^{
//Update the UI
});
} );
!
NSLog(@“After”);