I have this code to send a json string to a server
[NSURLConnection
sendAsynchronousRequest:req
queue:[[NSOperationQueue alloc] init]
completionHandler:^(NSURLResponse *response,
NSData *data,
NSError *error)
{
if ([data length] >0 && error == nil)
{
NSLog(@"Done");
}
else if ([data length] == 0 && error == nil)
{
NSLog(@"Nothing was downloaded.");
self.resultLabel.text=@"Done!";
self.view.userInteractionEnabled = TRUE;
}
else if (error != nil){
NSLog(@"Error = %@", error);
}
}];
The asynchronous request finishes fine and the logs show up almost immediately after it is finished. However, this code:
self.resultLabel.text=@"Done!";
self.view.userInteractionEnabled = TRUE;
Takes a good 10 seconds to show up in the UI. Anyone know why this would happen?