I've been teaching myself Xcode / Cocoa / Objective-C programming for the last year or so. I finally decided to delve into GCD. I couldn't believe how frickin' easy it was to add multi-threading to my app. I had several places where I was doing intensive non-UI related tasks that really needed to be relegated to another thread but just hadn't gotten around to it. Imagine my surprise when I discovered I only needed to add a couple of lines of code!
BEFORE
Code:
[bundle extractArchive];
[self setDownloadStatus];
[self showGrowlMessage:@"Extract Complete"];
AFTER
Code:
dispatch_async(dispatch_get_global_queue(0, 0), ^{
[bundle extractArchive];
dispatch_async(dispatch_get_main_queue(), ^{
[self setDownloadStatus];
[self showGrowlMessage:@"Extract Complete"];
});
});
Could they have made it any easier?!? Granted my app will only work with Snow Leopard, but that's okay.
Anyone out there have any experience/tips with regard to GCD?