How to handle a method in UIViewController subclass from super class
<p>I am creating a UIView-based application named <code>myapp</code>.</p>

<p>I am adding a UIViewController subclass to <code>myapp</code> named <code>mysubclass</code>.</p>

<p>In <code>mysubclass</code> I am animating some images.  My code in mysubclass looks like this:   </p>

<pre><code>-(void) onTimer {


    balloon.center = CGPointMake(balloon.center.x,balloon.center.y+pos.y);
    balloon1.center = CGPointMake(balloon1.center.x,balloon1.center.y+pos1.y);
    balloon2.center = CGPointMake(balloon2.center.x,balloon2.center.y+pos2.y);
    balloon3.center = CGPointMake(balloon3.center.x,balloon3.center.y+pos3.y);
    balloon4.center = CGPointMake(balloon4.center.x,balloon4.center.y+pos4.y);
    balloon5.center = CGPointMake(balloon5.center.x,balloon5.center.y+pos5.y);

        if(balloon.center.y &gt; 420 || balloon.center.y &lt; 25)
        pos.y = -pos.y;


    if(balloon1.center.y &gt; 420 || balloon1.center.y &lt; 25)
        pos1.y = -pos1.y;


    if(balloon2.center.y &gt; 420 || balloon2.center.y &lt; 25)
        pos2.y = -pos2.y;

    if(balloon3.center.y &gt; 420 || balloon3.center.y &lt; 25)
        pos3.y = -pos3.y;


    if(balloon4.center.y &gt; 420 || balloon4.center.y &lt; 25)
        pos4.y = -pos4.y;


    if(balloon5.center.y &gt; 420 || balloon5.center.y &lt; 25)
        pos5.y = -pos5.y;

}
</code></pre>

<p>I am calling this method like this: </p>

<p>in the same way i need to reverse the position at pos.y = 320.my code is look like this.  </p>

<pre><code> -(void) onTimer1 {


        balloon.center = CGPointMake(balloon.center.x,balloon.center.y+pos.y);
        balloon1.center = CGPointMake(balloon1.center.x,balloon1.center.y+pos1.y);
        balloon2.center = CGPointMake(balloon2.center.x,balloon2.center.y+pos2.y);
        balloon3.center = CGPointMake(balloon3.center.x,balloon3.center.y+pos3.y);
        balloon4.center = CGPointMake(balloon4.center.x,balloon4.center.y+pos4.y);
        balloon5.center = CGPointMake(balloon5.center.x,balloon5.center.y+pos5.y);

            if(balloon.center.y &gt; 320 || balloon.center.y &lt; 25)
            pos.y = -pos.y;


        if(balloon1.center.y &gt; 320 || balloon1.center.y &lt; 25)
            pos1.y = -pos1.y;


        if(balloon2.center.y &gt; 320 || balloon2.center.y &lt; 25)
            pos2.y = -pos2.y;

        if(balloon3.center.y &gt; 420 || balloon3.center.y &lt; 25)
            pos3.y = -pos3.y;


        if(balloon4.center.y &gt; 320 || balloon4.center.y &lt; 25)
            pos4.y = -pos4.y;


        if(balloon5.center.y &gt; 320 || balloon5.center.y &lt; 25)
            pos5.y = -pos5.y;

    }




   - (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval)duration {
UIInterfaceOrientation toorientation = self.interfaceOrientation;
    if ((toorientation == UIInterfaceOrientationPortrait) || (toorientation == UIInterfaceOrientationPortraitUpsideDown) )  {
    timer  = [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(onTimer) userInfo:nil repeats:YES];
else{
timer  = [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(onTimer1) userInfo:nil repeats:YES];
}
}
</code></pre>

<p>but it not working,may be the reason is we can't able to handle this in subviewcontroller class,if it is how can i handle this from super class.</p>

<p>if my guess is wrong,can any one please suggest what's the wrong.</p>

<p>Thank u in advance. </p>
