sendSynchronousRequest
is, as the name indicates, synchronous and therefore blocks
the current thread. Since all UI updates are only done when program control returns
to the main event loop, you have to move the upload to a separate thread,
for example like this:
self.progressLabel.text = @"Uploading...";
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0), ^{
NSData *returnData = [NSURLConnection sendSynchronousRequest:...];
// UI activity must be done on the main thread again:
dispatch_async(dispatch_get_main_queue(),^{
self.progressLabel.text = @"Done.";
});
});
Alternatively, you can use [NSURLConnection sendAsynchronousRequest:...]
.