Top "Grand-central-dispatch" questions

Grand Central Dispatch (GCD) provides a simple and robust mechanism for concurrent and asynchronous operations, primarily in Apple operating systems (e.g., iOS, macOS, watchOS, and tvOS), but also FreeBSD and MidnightBSD.

Possible to reset state of dispatch_once in unit test, to make them run again

Is it possible to reset the state of dispatch_once code in a unit test tearDown? I think it would …

objective-c grand-central-dispatch
NSOperationqueue background, download images

I created a NSOperationQueue to download images (from Twitter for Cell): NSOperationQueue *queue = [[NSOperationQueue alloc]init]; [queue addOperationWithBlock:^{ NSString *ImagesUrl = [[…

ios cocoa-touch asynchronous grand-central-dispatch nsoperationqueue
What does main.sync in global().async mean?

In Swift, I used this kind of pattern sometimes. DispatchQueue.global().async { // do stuff in background, concurrent thread DispatchQueue.main.…

ios swift grand-central-dispatch
Workaround on the threads limit in Grand Central Dispatch?

With Grand Central Dispatch, one can easily perform time consuming task on non-main thread, avoid blocking the main thead and …

ios objective-c grand-central-dispatch
Number of threads created by GCD?

Is there any good documention on how many threads are created by GCD? At WWDC, they told us it's modeled …

ios grand-central-dispatch
Which tasks are more suitable to NSOperation than GCD?

Which tasks would be better suited to using NSOperation as opposed to using GCD when programming for the iPhone? To …

ios cocoa-touch nsoperation grand-central-dispatch
iPhone: Using dispatch_after to mimick NSTimer

Don't know a whole lot about blocks. How would you go about mimicking a repeating NSTimer with dispatch_after()? My …

objective-c nstimer objective-c-blocks grand-central-dispatch invocation
need some clarifications about dispatch queue, thread and NSRunLoop

The following things are what I know & understand: Global queue is a concurrent queue which can dispatch tasks to …

ios multithreading grand-central-dispatch nsthread nsrunloop
dispatch_after looped / repeated

I am trying to create a loop like this: while (TRUE){ dispatch_after(...{ <some action> }); } After a viewDidLoad. …

ios objective-c grand-central-dispatch dispatch
swift 3 DispatchGroup leave causes crash when called in helper class function

I'm using DispatchGroup.enter() and leave() to process a helper class's reverseG async function. Problem is clear, I'm using mainViewController's …

swift grand-central-dispatch reverse-geocoding completionhandler