I recently spent the last 5 hours trying to debug a memory leak in my Spritekit application.
After starting the application, I noticed a slight increase in memory.
I spent 3 of these 5 hours breaking through the reference material, learning about the strong VS Weak with ARC (I definitely recommend reading this for Intermediates like me)
Anyone else having this problem? If so, is there any explanation? Here is a small snippet of my GameViewController:
class GameViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() if let scene = MainMenu(fileNamed:"MainMenu") { // Configure the view. let skView = self.view as! SKView skView.showsFPS = true skView.showsNodeCount = true skView.multipleTouchEnabled = true skView.showsPhysics = true /* Sprite Kit applies additional optimizations to improve rendering performance */ skView.ignoresSiblingOrder = true /* Set the scale mode to scale to fit the window */ scene.scaleMode = .Fill //var GameSaveData = GameData() // Scene Config //scene.Landscape = "Test_Landscape" //scene.Area = "Start" skView.presentScene(scene) }else{ print("Couldn't Load Game Scene") } }
As you can see, I am not doing anything unusual here. I would post the code of my game, but all of this was commented out while I was still observing a memory leak.
ios memory-leaks swift sprite-kit
luckybroman5
source share