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

  • SEARCH
  • Home
  • 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 8774419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:33:47+00:00 2026-06-13T18:33:47+00:00

Sometimes Cocoa allows a user to pass either NSOperationQueue or dispath_queue_t to the async

  • 0

Sometimes Cocoa allows a user to pass either NSOperationQueue or dispath_queue_t to the async method:

+[NSURLConnection sendAsynchronousRequest:queue:completionHandler:]
-[AVPlayer addBoundaryTimeObserverForTimes:queue:usingBlock:]
-[NSNotificationCenter addObserverForName:object:queue:usingBlock:]

Sometime doesn’t:

-[NSDocument continueActivityUsingBlock:]
-[NSSavePanel beginWithCompletionHandler:]
-[GKAchievementDescription loadImageWithCompletionHandler:]

To me, passing a queue to the method looks ambiguous, because you can always catch desired queue when you create a block. E.g.:

NSOperationQueue *q = …;
[aDocument continueActivityUsingBlock:^{
    [q addOperationWithBlock:^{
        // Do actual work here.
    }];
}];

Maybe I’m missing something and passing queues makes sense?

  • 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-13T18:33:49+00:00Added an answer on June 13, 2026 at 6:33 pm

    Depends.

    Do you need a callback on completion?

    If so, you might need to specify a queue. The type — NSOperationQueue vs. GCD queue — is up to you.

    However, if you define your callback as either always being invoked on the main queue (which would be appropriate for a callback that is always going to update the UI extensively) or is always going to be called asynchronously (i.e. the callback is dispatched onto an asynchronous queue, typically), there there is no reason to pass the targeted queue.

    If your callback is one where the expectation is that it will potentially interact with data whose manipulation must be serialized, defining an API that provides a serialization primitive — a queue — can be a powerful shortcut.

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

Sidebar

Related Questions

I'm using the scripting bridge to query iTunes from my cocoa application. Sometimes iTunes
I have some processing in my Cocoa app that sometimes ends up calling through
In the book, Cocoa Design Patterns, the author sometimes declares a property in the
For example, sometimes there's an import like this: #import <Cocoa/Cocoa.h> and sometimes the import
Within my Cocoa app, I call NSWorkspace's openFile: method to open some file with
How to determine string encoding in cocoa? Recently I'm working on a radio player.Sometimes
In iOS and Cocoa Touch, sometimes it seems we can get by without calling
Sometimes you come by Zip files with file or directory with some unrecognized characters
Sometimes i face the following problem : string txt = con.Request.Params[Par_name].ToString();//the original par value
Sometimes I feel the urge to put some more expressiveness in my git commit

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.