7 Replies
      Latest reply on Feb 4, 2019 6:12 PM by john daniel
      maark6000 Level 1 Level 1 (0 points)

        There seems to be a convention regarding nesting GCD calls... for example

         

         

            dispatch_queue_t queue = dispatch_queue_create("com.test123", NULL);

            dispatch_queue_t main = dispatch_get_main_queue();

          

            dispatch_async(queue,

                           ^{

                               [self methodNotMainThread];

                               dispatch_async(main, ^{ [self methodMainThread]; });

                           });

        ___

         

        is that different from:

         

             dispatch_async(queue,

                            ^{ [self methodNotMainThread];  });

             dispatch_async(main,

                             ^{ [self methodMainThread]; });

         

        what is the purpose of nesting here?