title: Sprite animation not working in NSThread method in Cocos2d
body: <p>I created a Thread like the below one:</p>
  
  <pre><code>[NSThread detachNewThreadSelector:@selector(connectionFinishedThread) toTarget:self withObject:nil];
  </code></pre>
  
  <p>inside this method, i created one sprite and given animation for this sprite. Animation not visible.</p>
  
  <p>My code inside the Thread method:</p>
  
  <pre><code>CCSprite *aniSprite = [CCSprite spriteWithSpriteFrameName:@"r_anim01.png"];
  aniSprite.position = ccp(50, 50);
  [self addChild:aniSprite z:22];
  
  [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"r_anim1.plist"];
  
  CCSpriteBatchNode *animSheet = [CCSpriteBatchNode batchNodeWithFile:@"r_anim1.png"];
  [self addChild:animSheet];
  
  NSMutableArray *animFrames = [NSMutableArray array];
  for (int i=1; i&lt;=6; i++) {
      [animFrames addObject:
       [[CCSpriteFrameCache sharedSpriteFrameCache] spriteFrameByName:
        [NSString stringWithFormat:@"r_anim1%d.png",i]]];
  }
  
  CCAnimation *anim = [CCAnimation animationWithSpriteFrames:animFrames delay:0.1f];
  CCAction *spriteAction = [CCRepeatForever actionWithAction: [CCAnimate actionWithAnimation:anim]];
  
  [sprite runAction:spriteAction];
  </code></pre>
  
  <p>Why it behaves like that?</p>