The Animating Just Won't Stop!

Discussion in 'iOS Programming' started by Phantom1812, Sep 14, 2010.

  1. Phantom1812 macrumors newbie

    Joined:
    Jul 20, 2010
    #1
    I am probably doing an incredibly stupid new-kid thing here, but I have a function that is called that fades and moves a UIView (sub-view on a parent UIViewController) on to the screen (and another function which moves it off). Everything works great, however after I am finished with the parent UIViewController and release it, everything I do in OTHER UIViewControllers after that, animates!! So things which have no animate block around them and have no connecion to the UIViewController or UIView that was being animated, all move and fade as if they are attached to the animation block.

    Any ideas why animating one UIView, then causes everything else on my application to animate thereafter?

    Below is the function that is called to animate a view :

    Code:
    -(void)animateQuestionOnFromRight:(UIView *)questionView {
    
    
    [UIView beginAnimations:nil context:NULL];
    
    questionView.alpha = 0.0;
    
    questionView.hidden = NO;
    [UIView beginAnimations:@"controlViewTransition" context:nil];
    [UIView setAnimationCurve:UIViewAnimationCurveLinear];  
    [UIView setAnimationDuration:0.40];
    questionView.alpha = 1.0;
    [UIView commitAnimations];
    
    
    questionView.frame = CGRectMake(1024, 69, 800, 610);
    questionView.hidden = NO;
    [UIView beginAnimations:@"controlViewTransition" context:nil];
    [UIView setAnimationCurve:UIViewAnimationCurveLinear];  
    [UIView setAnimationDuration:0.40];
    questionView.frame = CGRectMake(112, 69, 800, 610);
    [UIView commitAnimations];
    
    
    }

    Nothing more complicated than that I simply pass the UIView as an object into the function (questionView) and that is applied.


    Feel free to mock if I'm doing something stupid. :eek:)
     
  2. seepel macrumors 6502

    seepel

    Joined:
    Dec 22, 2009
    #2
    looks like you ar missing a commitAnimation message at the end there.
     
  3. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #3
    You have one animation loop, correct? One that both fades and moves the view simultaneously? If that's the case, why do you have three [UIView beginAnimations:context:] calls?
     
  4. Phantom1812 thread starter macrumors newbie

    Joined:
    Jul 20, 2010
    #4
    Why have one when you can have 3?? :)

    I will try cleaning the function up and trying again. Cheers for the pointer.
     

Share This Page