Loading view controllers one after the other with delay in a container view
<p>Loading multiple view controllers one after the other with delay like this</p>

<pre><code>-(void)playpauseAction:(id)sender {
if([audioPlayer isPlaying])
{
[sender setImage:[UIImage imageNamed:@"Play Icon.png"] forState:UIControlStateSelected];
[audioPlayer pause];
[self pauseTimer];
[self pauseLayer:self.view.layer];
}else{
[sender setImage:[UIImage imageNamed:@"pause.png"] forState:UIControlStateNormal];
[audioPlayer play];
[self resumeTimer];
[self resumeLayer:self.view.layer];  
if(isFirstTime == YES)
  {
 self.timer = [NSTimer scheduledTimerWithTimeInterval:11.0
                                     target:self
                                     selector:@selector(displayviewsAction:)
                                     userInfo:nil
                                     repeats:NO];
        isFirstTime  = NO;
    }}}

- (void)displayviewsAction:(id)sender
  {  
   First *firstController = [[First alloc] init];
   firstController.view.frame = CGRectMake(0, 0, 320, 480);
   CATransition *transitionAnimation = [CATransition animation];   
    [transitionAnimation setDuration:1];
    [transitionAnimation setType:kCATransitionFade];    
    [transitionAnimation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];    
    [self.view.layer addAnimation:transitionAnimation forKey:kCATransitionFade];
    [self.view addSubview:firstController.view];
    [self.view addSubview:toolbar];
    [firstController release];   
    self.timer = [NSTimer scheduledTimerWithTimeInterval:23 target:self selector:@selector(Second) userInfo:nil repeats:NO];     
    }

   -(void)Second 
   {
Second *secondController = [[Second alloc] init];
secondController.view.frame = CGRectMake(0, 0, 320, 480);
CATransition *transitionAnimation = [CATransition animation];
[transitionAnimation setDuration:1];
[transitionAnimation setType:kCATransitionReveal];
[transitionAnimation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
[self.view.layer addAnimation:transitionAnimation forKey:kCATransitionReveal];
[self.view addSubview:secondController.view]; 
[self.view addSubview:toolbar];
[secondController release];
self.timer = [NSTimer scheduledTimerWithTimeInterval:27 target:self selector:@selector(Third) userInfo:nil repeats:NO];
 }
</code></pre>

<p>Requirement is to add a container view and load all view controllers in containerview. </p>

<p>So, in the load view can create uiview and container view like this</p>

<pre><code>   - (void)loadView
    {
// set up the base view
CGRect frame = [[UIScreen mainScreen] applicationFrame];
UIView *view = [[UIView alloc] initWithFrame:frame];
view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
view.backgroundColor = [UIColor blueColor];

// set up content view a bit inset
frame = CGRectInset(view.bounds, 0, 100);
_containerView = [[UIView alloc] initWithFrame:frame];
_containerView.backgroundColor = [UIColor redColor];
_containerView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[view addSubview:_containerView];}
</code></pre>

<p>In the AppDelegate can do it like this</p>

<pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
  {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

ContainerViewController *container = [[ContainerViewController alloc] init];    
self.window.rootViewController = container;


// make an array of 23 PageVCs
NSMutableArray *controllers = [NSMutableArray array];
   [controllers addObject:firstcontroller];
   [controllers addObject:secondcontroller];
   [controllers addObject:.....];
    [controllers addObject:twentythreecontroller];

for (int i=0; i&lt;23; i++)
{
    First *firstController = [[First alloc] init];

[controllers addObject:firstcontroller, secondcontroller, .....,twentythreecontroller];
}

// set these as sub VCs
[container setSubViewControllers:controllers];

    [self.window makeKeyAndVisible];
    return YES;}
</code></pre>

<p>Loading all viewcontrollers in container view like this will be okay or doing something wrong in here. </p>

<p>Appreciate help for this.</p>

<p>Thanks.</p>
