Re: gif animation under a blocking
Re: gif animation under a blocking
- Subject: Re: gif animation under a blocking
- From: Andrew Farmer <email@hidden>
- Date: Thu, 17 May 2007 23:04:13 -0700
On 17 May 07, at 22:33, Koshiro MITSUYA wrote:
I am trying to have a gif image animating during a HTTP session
between a server.
However, the animation stopped when I called NSURLConnection because
(maybe) the connection is blocking the process.
<... snip...>
receivedData = [NSURLConnection sendSynchronousRequest:theRequest
returningResponse:&response error:&error];
sendSynchronousRequest is a blocking operation - it doesn't return
until the remote server is done responding. As such, it'll block the
UI until it's done, preventing other things from happening (like the
image animating). Run it on a separate thread or set up an
asynchronous connection using connectionWithRequest:delegate: and an
appropriate delegate.
Get used to using delegates. They're a common Cocoa idiom that you'll
have to learn sooner or later.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden