UIButton CATransition in unpredictable manner
===

I am developing a game using cocos2D and i am shifting from my home view which is a viewController class to gameScene. I am using UIButtons in home screen and i am using CATransition animation to reveal the buttons when the view appears. I am not releasing the home view when the game scene is loaded. The home view is present behind the game scene. And when the game scene ends, i hide the game scene and displays the home scene. 


This the code of creating the button :

       // Play Button
    btnPlay = [[UIButton alloc]init];
    btnPlay.frame = CGRectMake(65,95,124,50);
    [btnPlay addTarget:self action:@selector(btnPlayAction) forControlEvents:UIControlEventTouchUpInside];
    [btnPlay setBackgroundColor:[UIColor clearColor]];
    [btnPlay setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [btnPlay setHidden:YES];
    btnPlay.titleLabel.font = [UIFont fontWithName:@"NoteWorthy" size:25.0f];
    [btnPlay setBackgroundImage:[UIImage imageNamed:@"play.png"] forState:UIControlStateNormal];
    [self.view addSubview:btnPlay];
    [btnPlay setShowsTouchWhenHighlighted:YES];

This the code for CATransition of button : 

       CATransition *animation3 = [CATransition animation];
    [animation3 setDuration:3.0f];
    [animation3 setType:kCATransitionReveal];
    [animation3 setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
    [[btnPlay layer] addAnimation:animation3 forKey:@"SwitchToView"];
    
    [btnPlay setHidden:NO];

For few replays the transition goes well. But after few more replays of game, sometimes kCATransitionReveal happens and sometimes kCATransitionFromLeft happens. But i have not used kCATransitionFromLeft in my code. How it is happening?

Thanks for the help. 

 