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 7583461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T18:40:58+00:00 2026-05-30T18:40:58+00:00

I am currently working on an application which is parsing some JSON data in

  • 0

I am currently working on an application which is parsing some JSON data in the APPdelegate class when the location is changed.

My question is: ” How is the most appropriate way doing it ?” Currently when it is parsing the data the application is “frozen” until the data has been loaded.

I need some advice 🙂

Thanks

  • 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-05-30T18:40:59+00:00Added an answer on May 30, 2026 at 6:40 pm

    There are several ways of course, including NSThread, NSOperation and old-fashioned libpthread. But what I find the most convenient (especially for simple background tasks) is libdispatch also called Grand Central Dispatch.

    Using dispatch queues you can quickly delegate a time-consuming task to a separate thread (or more precisely, execution queue – GCD decides whether it’s a thread or an asynchronous task). Here’s the simplest example:

    // create a dispatch queue, first argument is a C string (note no "@"), second is always NULL
    dispatch_queue_t jsonParsingQueue = dispatch_queue_create("jsonParsingQueue", NULL);
    
    // execute a task on that queue asynchronously
    dispatch_async(jsonParsingQueue, ^{
        [self doSomeJSONReadingAndParsing];
    
        // once this is done, if you need to you can call
        // some code on a main thread (delegates, notifications, UI updates...)
        dispatch_async(dispatch_get_main_queue(), ^{
            [self.viewController updateWithNewData];
        });
    });
    
    // release the dispatch queue
    dispatch_release(jsonParsingQueue);
    

    The above code will read JSON data in a separate execution queue, not blocking the UI thread. This is just a simple example and there’s a lot more to GCD, so take a look at the documentation for more info.

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

Sidebar

Related Questions

I'm currently working on an oophp application. I have a site class which will
I'm currently working on desktop application which calls third party API. After authorizing against
I am currently working on an application which requires different behaviour based on whether
I am currently working on a sample application which uses QNetworkAccessManager to send the
Currently i am working on a desktop application which consists mathematical analysiss.I am using
I'm currently working on an application written in C#, which I'm embedding IronPython in.
I am currently working on a web application. I was just wondering which has
I'm working on a cross platform application in Java which currently works nicely on
I'm working on a Swing application (currently running on Java 1.6 update 11) which
I'm currently working on an application which keeps tracks of cats and their associated

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.