Quick question. I have some code I consider a bit dirty. Basically, in the AppDelegate, I embed my initial view and do some animation from there (call NSTimer at the end of loadView). At this point, before the timer fires, the AppDelegate continues processing code in applicationDidFinishLaunching.
Now, ultimately, once the animation is done with, I destroy this view and load my main view. The problem I have is that I do it from this viewController. I'd want to do it from the AppDelegate instead.
Confusing uh ? Here's a snippet of code to make it clearer :
Right now, NSTimer executes the selector I gave it, which in turn calls a second selector for the end of the animation. I then load the main view from that selector, resulting in App -> View -> View.
I'd want to somehow signal to AppDelegate that this viewcontroller is done so it can react and allocate a new view based on another controller.
Is there a way to do this ?
Now, ultimately, once the animation is done with, I destroy this view and load my main view. The problem I have is that I do it from this viewController. I'd want to do it from the AppDelegate instead.
Confusing uh ? Here's a snippet of code to make it clearer :
Code:
- (void)loadView {
...
[self.view addSubview:Animation];
[NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(doAnimate) userInfo:nil repeats:NO];
...
}
-(void)doAnimate {
...
[UIView setAnimationDidStopSelector:@selector(stopAnimate)];
...
}
-(void) stopAnimate {
[Animation removeFromSuperview];
[Animation release];
... (boring new view allocation) ...
[self.view addSubview:[viewController view]];
}
Right now, NSTimer executes the selector I gave it, which in turn calls a second selector for the end of the animation. I then load the main view from that selector, resulting in App -> View -> View.
I'd want to somehow signal to AppDelegate that this viewcontroller is done so it can react and allocate a new view based on another controller.
Is there a way to do this ?