Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8783835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:55:50+00:00 2026-06-13T20:55:50+00:00

I learned iOS programming thanks to Stanford’s CS193p course (on iTunes U) as well

  • 0

I learned iOS programming thanks to Stanford’s CS193p course (on iTunes U) as well as the iOS programming book from Big Nerd Ranch. In both of those, they recommend using dispatch_async(), dispatch_get_main_queue(), etc. to handle threading and concurrent operations. However, at WWDC 2012’s session on building concurrent UI, the speaker recommended the use of NSOperationQueue.

What are the differences between dispatch_*() and NSOperationQueue, and is there any reason (technical, performance, stylistic, or otherwise) that I should use one over the other? Is NSOperationQueue just an Objective-C wrapper around dispatch_async, or is there more to it than that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:55:51+00:00Added an answer on June 13, 2026 at 8:55 pm

    NSOperation* classes are the higher level api. They hide GCD’s lower level api from you so that you can concentrate on getting the task done.

    The rule of thumb is: Use the api of the highest level first and then degrade based on what you need to accomplish.

    The advantage of this approach is that your code stays most agnostic to the specific implementation the vendor provides.
    In this example, using NSOperation, you’ll be using Apple’s implementation of execution queueing (using GCD). Should Apple ever decide to change the details of implementation behind the scenes they can do so without breaking your application’s code.
    One such example would be Apple deprecating GCD and using a completely different library (which is unlikely because Apple created GCD and everybody seems to love it).

    Regarding the matter i recommend consulting the following resources:

    • http://nshipster.com/nsoperation/
    • https://cocoasamurai.blogspot.de/2009/09/guide-to-blocks-grand-central-dispatch.html
    • https://cocoasamurai.blogspot.de/2009/09/making-nsoperation-look-like-gcd.html
    • https://www.raywenderlich.com/76341/use-nsoperation-nsoperationqueue-swift
    • https://developer.apple.com/documentation/foundation/operationqueue
    • Video: Advanced NSOperations, WWDC 2015, Session 226
    • Sample code: Advanced NSOperations, WWDC 2015
    • Video: Building Responsive and Efficient Apps with GCD, WWDC 2015, Session 718

    Now, regarding your specific questions:

    What are the differences between dispatch_*() and NSOperationQueue, […]

    See above.

    […] and is there any reason (technical, performance, stylistic, or otherwise) that I should use one over the other?

    If the NSOperation stuff gets your job done, use it.

    Is NSOperationQueue just an Objective-C wrapper around dispatch_async, or is there more to it than that?

    Yes, it basically is. Plus features like operation dependencies, easy start/stop.

    Amendment

    To say, use the highest level api first might sound intriguing. Of course, if you need a quick way to run code on a specific thread, you don’t want to write a whole lot of boilerplate code which makes the use of lower level C functions perfectly valid:

    dispatch_async(dispatch_get_main_queue(), ^{
      do_something();
    });
    

    But consider this:

    [[NSOperationQueue mainQueue] addOperationWithBlock:^{
      do_something();
    }];
    

    I’d recommend the latter because most of what you’ll write is Objective-C anyway so why not embrace its expressiveness?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From the Apple WWDC we have learned that iOS Safari 5 has tabs, and
I learned my app does not behave well on multitasking iOS in case a
I am receiving images from an iOS device, and from what I've learned here
I am new to iOS programming, and have recently learned a valuable lesson in
I learned of gist.github.com from Mozilla Ubiquity , and have been using it to
I've been doing iOS development for a couple of months now and just learned
I'm starting to work with OpenGL in iOS. I have always learned to draw
I learned from this article that to avoid confliction between javascript libraries, use jQuery.noConflict();
I learned Django following django book and the document. In the django book exmaple,
I learned that it is from the devil to test String equality with ==

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.