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.

How can I retrieve a return value from a completion block?

Is it possible to run a completion block on the main thread? For example, I have one method which returns …

iphone ios objective-c-blocks grand-central-dispatch
Best practice to send a lot of data in background on iOS4 device?

I have an app that needs to send data (using POST) to a server. This function has to be on …

iphone ios multithreading grand-central-dispatch nsoperation
(iOS) dispatch_async() vs. NSOperationQueue

I learned iOS programming thanks to Stanford's CS193p course (on iTunes U) as well as the iOS programming book …

grand-central-dispatch nsoperationqueue
Core Data and threads / Grand Central Dispatch

I'm a beginner with Grand Central Dispatch (GCD) and Core Data, and I need your help to use Core Data …

iphone ios multithreading core-data grand-central-dispatch
Wait for completion handler to finish - Swift

I am trying to check if UserNotifications are enabled and if not I want to throw an alert. So I …

ios swift closures grand-central-dispatch completionhandler
How do I create a deadlock in Grand Central Dispatch?

In Apple docs, it says: Important: You should never call the dispatch_sync or dispatch_sync_f function from a …

ios objective-c xcode grand-central-dispatch
GCD and async NSURLConnection

I know that if I create an NSURLConnection (standard async one), it will call back on the same thread. Currently …

objective-c ios grand-central-dispatch
Can you use cancel/isCancelled with GCD/dispatch_async?

I've been wondering, can you use cancel/cancelAllOperations/.isCancelled with a thread you have launched with GCD? Currently, I just …

iphone multithreading ios nsoperation grand-central-dispatch
NSThread vs. NSOperationQueue vs. ??? on the iPhone

Currently I'm using NSThread to cache images in another thread. [NSThread detachNewThreadSelector:@selector(cacheImage:) toTarget:self withObject:image]; Alternately: [self …

iphone nsthread nsoperationqueue grand-central-dispatch