Background Thread to Call Methods

2019-03-05 14:32发布

问题:

I've found this method to work with background thread. My question is that I've run a whole process in background thread which include number of methods. Frist method calls the second one and the the second one makes some data and pass it to the third one.

-(void)firstMethod
    dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){

      if(someCondition == 0)
      {
        [self secondMethod:myArray];
      }
    }
       dispatch_async(dispatch_get_main_queue(), ^(void){

        [self.navigationController popViewControllerAnimated:YES];
            });
    });
}
    -(void)secondMethod:(NSArray *)array {
       a= a+3;
       [self thirdMethod:array[a];
    }

So you get the general idea right? So do I have to put the functionality of second and third method in background thread too? Or how this whole process will take place?