I'm dealing with a strange problem where tapping the button once triggers constant memory growth (but doesn't with certain lines of code commented). It also prevents the button from actually working (I noticed UIViewIgnoresTouchEvents being called in the second picture). The answer could be painfully obvious but I just can't see it. I've highlighted in red the areas where things go awry.
I'm new to instruments and can't properly make sense of everything so I've narrowed down what seems to cause the problem in my code: lines of code with .text appear to be responsible, such as:
let formatterHighscore = NSNumberFormatter()
formatterHighscore.numberStyle = .DecimalStyle
highscoreLabel.text = "" + formatterHighscore.stringFromNumber(Int(highScore))!
or even something as innocuous looking as this:
if ... {
exampleLabel.text = "You won!"
}
else {
exampleLabel.text = "You lost..."
}
But in this case only when exampleLabel.text = "You lost..."
is uncommented. It all seems very fickle as sometimes this sort of code makes the growth occur and other times it doesn't.
Any advice would be great