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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:36:04+00:00 2026-05-14T00:36:04+00:00

I went to the iPhone Developer Tech Talk a few months ago and asked

  • 0

I went to the iPhone Developer Tech Talk a few months ago and asked one of the gurus there about the lack of NSHost on the iPhone. Some code I was porting to the iPhone made significant use of NSHost throughout its networking code.

I was told that NSHost is on the iPhone, but its private. I was also told that NSHost is a synchronous API and that I shouldn’t use it anyway. (If anyone could elaborate on why it shouldn’t be used, as a bonus, that’d be great.)

I can see the caveats of using synchronous API’s on the main thread in that they’ll block until complete – and that’s never a good thing with network code because there are so many factors that could cause the API to block the thread for a significant amount of time.

My solution was to write a wrapper around CFHost’s asynchronous resolution functions.

The result works quite well, and I’m considering releasing it into the public domain.

But my question is this: Say my app only resolves a hostname once per run, during the connecting phase, and then cache’s it for the rest of the session. During the time it is resolving, a modal screen is shown telling the user “Connecting” with a nice spinner.

Does it really matter whether or not the resolution is asynchronous?? The user has to wait to connect anyway, and the resolution is only done on the first connection. Subsequent connections use the cached result of the resolution.

When is it OK to be synchronous and when should things be asynchronous?

  • 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-14T00:36:05+00:00Added an answer on May 14, 2026 at 12:36 am

    Your nice spinner won’t spin, since the UI will get blocked as well during the synchronous call. Sure, you can make the call on a separate thread, but then you’re doing essentially the same thing as the asynchronous call.

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

Sidebar

Related Questions

I went through the example from apple MoviePlayer on iPhone Im trying to overlay
I went through this whole procedure http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx a couple weeks ago and got https
I went to Twitter's resource page here (https://twitter.com/about/resources/tweetbutton) and got the following code: <a
Last year I received two Technical Support Incidents in the iPhone developer program, but
itunes asked me to upgrade my iphone's OS to 3.1.3, so I complied naively.
I updated my iPhone to the new OS 4.0 and went to build my
I went through this tutorial Your First iPhone Application and it worked great. My
I went through the tutorial here: http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application , and I can get a graph
I am pretty new to iPhone and spent some months on it but.....But i
When I am submitting the iPhone and iPad apps, the iPhone app went through

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.