Maybe this is easy, but I'm lost.
I have a project where I have to make a full-screen animation that uses 8 jpgs to simulate a page opening. So what I am doing is:
- I have an SKSpriteNode that displays on the full screen
- making an array of 8 SKTextures
- using SKTexture preloadTextures to load them
- once they're loaded, I use animateWithTextures to show the animation
- later on, another method removes the SKSpriteNode from the scene.
When I first do the page turn, it uses a ton of memory, but when I run removeFromParent on it, the memory continues to be used.
My .m file declares this at the top:
SKSpriteNode *pageTurnNode;
because I want to be able to refer to it easily in both methods.
How do I get rid of all those textures and whatnot?
Textures may not be released from memory immediately. Apparantely Sprite Kit employs a caching system. It will remove cached textures when it sees fit.
That and what @prototypical said.