MCQs > IT & Programming > Objective C > What happens at runtime with the following: NSMutableString *tempString = [NSMutableString stringWithString:@"1"]; dispatch_sync(dispatch_get_main_queue(), ^{ [tempString appendString:@"2"]; NSLog(@"%@", tempString); }); [tempString appendString:@"3"];

Objective C MCQs

What happens at runtime with the following: NSMutableString *tempString = [NSMutableString stringWithString:@"1"]; dispatch_sync(dispatch_get_main_queue(), ^{ [tempString appendString:@"2"]; NSLog(@"%@", tempString); }); [tempString appendString:@"3"];

Answer

Correct Answer: Log doesn't print anything. It's a deadlock here because the main queue will block on the call to dispatch_sync

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Objective C Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Objective C Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it