0

I'm pushing a scene to the game I'm working on, after pressing a button in the main menu.

This scene is a gameplayScene which should have two layers ad childs: boardLayer and hudLayer.

for now I'm testing with the boardLayer, I'm using block to call the gameplayScene to close both itself and the boardLayer, but by the time I get there the retain count of both layer is 3 (seems to be increasing after setting the block to 2, and I'm not sure when it is going up to 3)

What cause this, and how should it be handled?

bbum
  • 162,346
  • 23
  • 271
  • 359
Shefy Gur-ary
  • 628
  • 8
  • 19

1 Answers1

3

What cause this, and how should it be handled?

What causes it is irrelevant unless you have a leak. Then you use the Allocations Instrument and/or Build and Analyze to track down and fix the memory accretion.

retainCount is useless; don't call it. http://whentouseretaincount.com/

bbum
  • 162,346
  • 23
  • 271
  • 359
  • Bbum: I think your favorite tag is [retaincount]! :) – nielsbot Sep 08 '12 at 17:57
  • I may or may not have a retaincount RSS feed amongst other SO feeds. :) – bbum Sep 08 '12 at 18:36
  • :) thanks. You were right, I solved it by looking for leaks, and making sure I get to the dealloc. When I had no leaks and got to the dealloc I had a crash due to zombie, and when I figured out what it was, is solved it. – Shefy Gur-ary Sep 09 '12 at 12:48