tags:

views:

21

answers:

1

I have a UIView that is in my mainWindow.xib.

UIView *loadingView; @property (nonatomic, retain) IBOutlet UIView *loadingView;

The view has a label and UIActivityIndicator on it, and I'm trying to use the view as a "Please wait, loading..." screen. Before I push a new view onto the stack, I call [window bringSubviewToFront:loadingView] from the main delegate. The new view is pushed onto the stack, and in the viewDidLoad method of the new view I load some data across the web. Once this data transfer completes, I am calling [window sendSubviewToBack:loadingView]; at the end of viewDidLoad method.

If I test it just calling the bringSubviewToFront method only, the view is placed on top of every other view, which is working as planned. I shortened the loadingView height so I can see the new view correctly load behind it. If I add the SendSubviewtoBack after all my web service calls have completed on the new view, the loadingView never becomes visible. Is this a threading issue, or logic issue? I'm not sure how to fix it.

Thanks!

A: 

Don't quite understand what's wrong. What exactly does not work? I mean, if everything works as planned, what are you trying to fix?

gurghet
If I add the SendSubviewtoBack after all my web service calls have completed on the new view, the loadingView never becomes visible. Is this a threading issue, or logic issue? I'm not sure how to fix it.
James
To clarify: The view never shows when I put the sendSubviewToBack call at the end of the viewDidLoad method. If I leave it out, I see the new view load behind my mainWindow subview.
James
myAppDelegate *appDelegate = (myAppDelegate *)[[UIApplication sharedApplication]delegate]; [appDelegate startIndicator]; StatsDateSelectController *selectcity = [[StatsDateSelectController alloc] initWithNibName:@"StatsDateSelectController" bundle:nil]; // Push the next form onto our stack [self.navigationController pushViewController:selectcity animated:NO]; [selectcity release];
James
That is what I understood:1. you call bringSubviewToFront => OK2. you call bringSubviewToBack => OK3. you call bringSubviewToFront => nothing happens.is that right?
gurghet