Monday 9 September 2013

Delay when updating ios ui elements from Afnetwork blocks

Delay when updating ios ui elements from Afnetwork blocks

In my app when the user presses a button I start a HTTP asynchronous
request (using AFURLConnectionOperation) and change the text of UILabel in
the completionHandler block. This change, however, does not take place
when the request is concluded and instead happens around 2-3 seconds
later. Below is a code snippet that results in this behavior.
AFURLConnectionOperation* operation = ...
[opration setCompletionBlock:^{
NSLog(@"This text appears immediatly");
[myLabel setText:@"this one is delayed for 2-3 sec"];
}];
[opreation start];
tahnks for help

No comments:

Post a Comment