On 2009 Jan, 13, at 14:24, Kevin Gessner wrote:

On Jan 13, 2009, at 4:27 PM, JB wrote:

How can I force my code to wait for the asynchronous request to finish,
without using sendSynchronousRequest?

You can split your post-connection stuff into another method, and call it from the delegate's implementation of connectionDidFinishLoading:. Then it will be called only when the connection is complete.

How will that cause the main thread to block, as JB desires?

My code for doing this starts the connection in a different thread, then enters an infinite loop which checks for either a response or a user cancellation every 50 milliseconds, breaking when either is received.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to