title: How can I make sprite universal in Cocos2d iOS for garbage cleanup?
body: <p>I'm currently learning Cocos2D and I can't figure out how to access my sprite '_imgStudio' to make it universal so I can clean it up the image after my "removeStudio" timer finishes. I'd like to be able to move both the CCSprite draw functions into the spawnStudio function and to kill it once the timer finishes running.  </p>
  
  <p>However, I get an error saying 'Use of undeclared identifier '_imgStudio' so my removeStudio timer right now is pretty much useless.</p>
  
  <p>Here's part of my helloWorldFile. </p>
  
  <pre><code>@implementation GameEngine
  +(CCScene *) scene
  {
  CCScene *scene = [CCScene node];
  GameEngine *layer = [GameEngine node];
  [scene addChild: layer];
  
  return scene;
  }
  
  #pragma mark Main Initializer
  //Initalizes GameSetup
  
  -(id) init
  {
   if( (self=[super init]) ) {
      NSLog(@"Game Setup Worked!");
  
      CGSize winSize = [CCDirector sharedDirector].winSize;
      CCSprite *_imgStudio = [CCSprite spriteWithFile:@"Studio~ipad.png"];
      _imgStudio.opacity = 0;
      _imgStudio.position = ccp(winSize.width/2, winSize.height/2);
      [_imgStudio runAction:[CCFadeTo actionWithDuration:2.5f opacity:255]];
      [self addChild:_imgStudio];
  
      [self scheduleOnce: @selector(spawnStudio:) delay:10];
      [self scheduleOnce: @selector(removeStudio:) delay:20];
  }
  return self;
  }
  
  -(void) spawnStudio: (ccTime) dt {
      NSLog(@"TEST");
  }
  
  -(void) removeStudio: (ccTime) dt {
      [_imgStudio removeFromParentAndCleanup:YES];
      NSLog(@"ImageRemoved");
  }
  </code></pre>
  
  <p>Thanks!     </p>