title: UIViewAnimation Increase the memory
body: <p>In my project i implemented a ticker animation which scrolls text horizontally.</p>
  
  <p>my problem is when i goes to another viewcontroller memory starts to increase constantly.</p>
  
  <p>here is my code for ticker animation</p>
  
  <pre><code>-(void)scrollTheBreakingNews
  {
  
  if (isTicker)
  {
      self.ticker.text = textToScroll;
  
      if (!pauseTicker)
      {
          if (isTicker)
          {
              NSAttributedString *str = [[NSAttributedString alloc]initWithString:textToScroll];
  
              CGSize textSize = [str size];
  
              if (isTicker)
              {
                  float duration = (textSize.width + self.tickerView.frame.size.width) / 65.0f;
  
                  float startingX=0.0f;
                  float endX=0.0f;
  
                  if (isTicker)
                  {
                      self.ticker.frame = scrollLabelFrame;
                      if (isTicker)
                      {
                          startingX = self.tickerView.frame.size.width;
                          endX = -textSize.width;
                          if (isTicker)
                          {
                              self.ticker.frame = CGRectMake(startingX, 0.0f, textSize.width, 25.0f);
  
                              [UIView beginAnimations:@"" context:nil];
                              [UIView setAnimationCurve:UIViewAnimationCurveLinear];
                              [UIView setAnimationDuration:duration];
                              [UIView setAnimationDelegate:self];
                              [UIView setAnimationDidStopSelector:@selector(tickerStop)];
  
                              if (isTicker)
                              {
                                  CGRect tickerFrame = self.ticker.frame;
                                  tickerFrame.origin.x = endX;
                                  if (isTicker)
                                  {
                                      [self.ticker setFrame:tickerFrame];
                                      [UIView commitAnimations];
                                  }
                              }
                          }
                      }
                  }
              }
          }
      }
  }
  
  }
  
  -(void)tickerStop
  {
      if (isTicker)
      {
          if (!pauseTicker)
          {
              [self scrollTheBreakingNews];
          }
  
      }
      else
      {
          textToScroll=nil;
      }
  }
  </code></pre>
  
  <p>memory goes like this:</p>
  
  <p><img src="https://i.stack.imgur.com/5rk6j.png" alt="enter image description here"></p>
  
  <p>please help me to solve this. any suggestions appreciated. thanks in advance </p>