views:

42

answers:

0

I've just started iPhone development, and have come across an annoying problem. I am transitioning from one view to another, however in the interim I'd like to display a loading image.

The controller currently contains a TableView and TabControl. I have added an image and label to the control (of a 'loading' image) and linked them up to their associated properties. They are then @synthesized in the main control.

If I set both of these elements to 'hidden' in the designer, they don't show. If I don't, they do - which makes sense.

However, if I set them both to hidden, then programmatically call imageView.hidden=NO, it does not 'appear'. Is there something I'm missing? If the initial property is set to hidden=NO, i can programmtically set this to YES, but not back to NO. The same applies when setting the .alpha of these controls.

See below for the code i'm using. Any help would be appreciated - thanks :)

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 

 ForumThread *thread = [threadsArray objectAtIndex:indexPath.row];

 loadingLabel.hidden = NO;
 imageView.hidden = NO;

 ThreadViewController *threadViewController = [[ThreadViewController alloc] initWithThreadId: [thread threadID]];

 loadingLabel.hidden = YES;
 imageView.hidden = YES;

 [[self navigationController] pushViewController:threadViewController animated:YES];

 threadViewController.title = [thread threadTitle]; 
 [threadViewController release];   
}

There should be a gap of about 2s where the image/label should be visible. Any help would be appreciated!