dispatch_queue_t queue = dispatch_queue_create("setup_cell", NULL);
dispatch_async(queue, ^{
//Line 1
//Line 2
});
Would this wait until line 1 was finished, before calling line 2?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes (in most situations). Objective-C, like C is a top-down language, meaning that generally, a block code that happens above another block of code will execute before it.
The only real way this wouldn’t happen is through compiler optimization, but I wouldn’t worry about it, as compilers are usually smart enough to keep the code top-down even through all the optimizations they do.