Blocking Method Return
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