Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Concurrency Programming in iOS

Amit Bijlani Sam Soffes

Hey guys. I've been studying GCD since having started the Photobombers lesson and ran across something similar called NSOperationQueue, but I can't seem to tell the difference between the two. Is there one that's more efficient than the other? Does one have more features than the other?

2 Answers

Sam Soffes
STAFF
Sam Soffes
Treehouse Guest Teacher

Internally, NSOperationQueue uses GCD. Personally, I find GCD easier to get started with. NSOperationQueue has some really neat features and gives you extra control over how things run. For something like the Photo Bombers app, it is definitely overkill in my opinion.

It would be a good exercise to try to convert everything to NSOperationQueue to get to know it though. Both NSOperationQueue and NSOperation have a lot of documentation. Read through that and try it out! You might also take a look at AFNetworking's operation subclass to get a feel for it.

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

NSOperationQueue is a high level API for using GCD. So if you find GCD too complicated then use NSOperationQueue.

Thanks!