The method you're using to upload the image is synchronous, so it runs on the main thread, blocking the UI.
You might want to look at an asynchronous equivalent, or run this upload code in a background thread.
If you choose the background thread option, be aware that UI can
only be updated on the main thread.
An example of running on a background thread is as follows:
Code:
-(IBAction) uploadButtonPressed:(id) sender {
uploadLabel.hidden = NO;
loadingSquare.hidden = NO;
uploadIndicator.hidden = NO;
[uploadIndicator startAnimating];
[NSThread detachNewThreadSelector:@selector(theProcess) toTarget:self withObject:nil];
}
- (void)theProcess {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
// do the upload
[self performSelectorOnMainThread:@selector(processDone) withObject:nil waitUntilDone:NO];
[pool release];
}
- (void)processDone {
// stop the activityIndicator
[self dismissModalViewControllerAnimated:YES];
}