• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Blocking Method Return
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Blocking Method Return


  • Subject: Blocking Method Return
  • From: "Josh Ferguson" <email@hidden>
  • Date: Thu, 1 Dec 2005 13:30:01 -0600
  • Thread-topic: Blocking Method Return

I'm currently writing a library that implements some asynchronous
networking code and performs a series of tasks. I want the entrypoint
for this library to be synchronous - so that the method doesn't return
until all the networking is done. Here's my specific scenario:



1.) Third party app calls into -[MyController method1]



2.) -method1 creates an asynchronous NSURLConnection and downloads
some data



3.) Because NSURLConnection is asynchronous (which I need for
progress updates), method1 returns immediately.



Step 3 is what I need to change. I don't want my method1 to return until
all the asynchronous networking is done. To complicate matters, there's
also UI involved (a WebView may be displayed). How do I go about
blocking method1 until we're completely finished, without blocking the
entire thread? I'm sure there's a simple answer - I'm just not sure at
all how to tackle the problem.



Josh

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Blocking Method Return
      • From: j o a r <email@hidden>
    • Re: Blocking Method Return
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Re: change app name in dock on the fly
  • Next by Date: Drawing a rectangular matrix of circles - an NSMatrix?
  • Previous by thread: Re: Help on subclassing
  • Next by thread: Re: Blocking Method Return
  • Index(es):
    • Date
    • Thread