title: Cocos2d retain an object in C#
body: <p>I have a method which sets up CCAnimation's for me</p>
  
  <pre><code>public CCAnimation SetupAnimations(string prefixOFSprite, int numberOfFrames, int startFrame)
      {
          //me getting desperate and doing any old initilisation
          CCAnimation finalAnimation = new CCAnimation();
          finalAnimation = CCAnimation.animation();
  
          for (int i = startFrame; i &lt; numberOfFrames + 1; i++)
          {
              finalAnimation.addFrameWithFileName(prefixOFSprite + "-" + i);
          }
  
          float delay = 0.07f;
          finalAnimation.setDelay(delay);
  
          return finalAnimation;
  </code></pre>
  
  <p>Which I call like this</p>
  
  <pre><code>whiteDogBeginFalling = SetupAnimations("GameGraphics/dog/falling/white-falling", 7, 1)
  </code></pre>
  
  <p>But the animations don't play when I run the game :( This is me porting my game from iOS, and I got round this problem by adding</p>
  
  <pre><code>[whiteDogBeginFalling retain]
  </code></pre>
  
  <p>straight after the method call.</p>
  
  <p>How do you do this in the C# version of cocos2d? Or can anyone help me come up with another solution?</p>
  
  <p>Thanks in advance</p>