Users Pricing

forum

home / developersection / forums / how to use dispatch_async, dispatch_sync in objective-c?

How to use dispatch_async, dispatch_sync in Objective-C?

Anonymous User 3036 13 Jan 2016

I have a need to create serial queue in our iPhone app. I use dispatch_queue_t in our code like this:

dispatch_queue_t MyQueue = dispatch_queue_create("My Queue", DISPATCH_QUEUE_SERIAL);

But I want to know the difference between dispatch_sync and dispatch_async.
Can anyone explain me both differences? and which will be the best to use in our code.
Thank you.


I am a content writter !


1 Answers