Shay
Shay

Reputation: 2605

uiimage of uiimageview doesn't update before NSURLConnection sendSynchronousRequest (iphone)

I'm replacing an uiimage of uiimageview before calling NSURLConnection sendSynchronousRequest, an as a result i don't see the new uiimage.

How i can resolve this?

tnx

Upvotes: 0

Views: 570

Answers (2)

Nikolai Ruhe
Nikolai Ruhe

Reputation: 81848

Let the UI update happen (from the run loop) before sending your synchronous request. Use NSObject's performSelector:withObject:afterDelay: to schedule a method after a (zero) delay. In the method you specify in the selector argument you would send the request.

Upvotes: 1

drawnonward
drawnonward

Reputation: 53659

Make an asynchronous request or move the synchronous request into a separate thread. You can use performSelectorInBackground:withObject: for simple cases.

Upvotes: 0

Related Questions