Q:

Creating a CCSprite from "CCTextureCache"

So I am preloading most of my resources into the CCTextureCache and I am wondering how I go about creating sprites from the CCTextureCache. I know that in general I usually just do `CCSprite spriteWithFile`` But I am not sure how to go about accessing my textures once they are cached.

A:

well
CCSprite *spr = [CCSprite spriteWithFile:@"theSprite.png"];

actually puts the texture in cache with the file name as key.
so 
CCTexture2D * tex = [CCTextureCache sharedTextureCache:textureForKey:@"theSprite.png"];

will actually give you back the sprite's texture.
One last bit : before putting the texture in cache, the CCSprite constructor verifies if the cache already contains a texture with the key. If it does, it skips a whole bunch of steps and returns you the sprite constructed with the cached texture. 

