I have been struggling with this for days, for some reason my SKScenes are not deallocating correctly, this results in bounded memory growth as each time i exit and enter a
Based on your posted code, I suggest you add this to your MainMenu:
-(void) willMoveFromView:(SKView *)view {
[self removeAllChildren];
backgroundImage = nil;
topBar = nil;
bottomBar = nil;
ladybirds = nil;
title = nil;
subtitle = nil;
coffee = nil;
settingsWin = nil;
iapWin = nil;
unlocksWin = nil;
startButton = nil;
continueButton = nil;
settingsButton = nil;
iapButton = nil;
unlocksButton = nil;
theParticles = nil;
}
Add this to your SettingsScene:
-(void) willMoveFromView:(SKView *)view {
[self removeAllChildren];
backButton = nil;
resetButton = nil;
resetTutorialsButton = nil;
creditsButton = nil;
titleLabel = nil;
copyrightLabel = nil;
resetGameAlert = nil;
resetTutAlert = nil;
theScene = nil;
theTransition = nil;
menuBg = nil;
}
Keep in mind that SK uses its own caching which you have no control over. This means you will see an increase in memory the first couple of times you switch scenes but it will level out at some point. I suggest you move back and forth 15 to 20 times and see what happens.