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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:13:45+00:00 2026-05-23T10:13:45+00:00

I am writing an app that uses multithreading and cache. Quite similar to Apple’s

  • 0

I am writing an app that uses multithreading and cache. Quite similar to Apple’s TopSongs sample code. Upon startup, I need to grab the value of an object in a JSON feed.

Now I am afraid doing so would ruin the workflow of the app, and block a thread or something if I use NSURLConnection. Can I just download that JSON feed (it only has one object) without using NSURLConnection’s delegate methods? If I implement the delegate methods in my delegate file, then the app will finish up applicationDidFinishLaunching:application method and THEN go to

connection:didReceiveResponse:
connection:didReceiveData:
connection:didFailWithError:
connectionDidFinishLoading:

How can I avoid that? I need to get the timestamp (stored in that JSON file) right at the beginning of applicationDidFinishLaunching:application as the rest of that method depend on that timestamp.

Thank you,

  • 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-23T10:13:46+00:00Added an answer on May 23, 2026 at 10:13 am

    There are two ways to achieve this:

    Use the sendSynchronousRequest of NSURLConnection, but this will block until a response is received

    + (NSData *)sendSynchronousRequest:(NSURLRequest *)request returningResponse:(NSURLResponse **)response error:(NSError **)error
    

    or (the preferable option)

    Move the code which relies on the JSON to a seperate method. Use the asynchronous + delegate methods of NSURLConnection as normal, but in your applicationDidFinishLaunching method display some sort of HUD to inform the user of what’s happening and then in the connection:didReceiveResponse method or connectionDidFinishLoading method call your new method which relies on the JSON (and will now have the JSON) and dismiss the HUD.

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

Sidebar

Related Questions

I am writing a small web app that uses PHP code to email a
I am writing an app that is similar to a slide show and uses
I am writing an app that uses Highcharts, and in one instance I want
I am writing an app that uses the TimeSpan object. Specifically I am using
So I've been writing an app that uses an alarm to open a service
Hey--I'm writing a basic Rails app that uses the digg API. I'm trying to
I am currently writing an Android app that, among other things, uses text information
I am writing an app that uses iCal sync'd from iCloud. I want the
I am writing an app that uses the UITabBarController at the bottom. Hierarchy -
I'm writing an app that uses UITabBar for parts of the navigation. I'm also

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.