Inherits from NSObject
Declared in SPTextureCache.h

Overview

The texture cache keeps weak references to all loaded textures.

When you try to instantiate a texture that is already in memory, it is taken from the cache instead of loading it again.

This is an internal class. You do not have to use it manually.

Tasks

  • – textureForKey:

    Returns the texture stored with the given key, or nil if that texture is not available.

  • – setTexture:forKey:

    Stores a weak reference to the given texture. The texture is not retained; when it is deallocated, it is automatically removed from the cache.

  • – purge

    Removes all references.

Instance Methods

purge

Removes all references.

- (void)purge

Discussion

Removes all references.

Declared In

SPTextureCache.h

setTexture:forKey:

Stores a weak reference to the given texture. The texture is not retained; when it is deallocated, it is automatically removed from the cache.

- (void)setTexture:(SPTexture *)obj forKey:(NSString *)key

Discussion

Stores a weak reference to the given texture. The texture is not retained; when it is deallocated, it is automatically removed from the cache.

Declared In

SPTextureCache.h

textureForKey:

Returns the texture stored with the given key, or nil if that texture is not available.

- (SPTexture *)textureForKey:(NSString *)key

Discussion

Returns the texture stored with the given key, or nil if that texture is not available.

Declared In

SPTextureCache.h