Wrapping asynchronous code in a synchronous method call
Hi,
I wonder how I would go about wrapping some aSynchronous code into a synchronous method call, like the NSURLConnection sendSynchronousRequest:returningResponse:error: method. It wraps the aSynchronous NSURLConnection code into this synchronous method. I'd like to do this do because I need to alter some of the delegate methods of NSURLConnection, but I do need it to be synchronous.
How would I do this? Or, in general, how could I block the calling thread until I notify it?
Thanks in advance.
|