Quote:
|
But what you mention about the !done if statement, is this really necessary even if you are calling the 'setAnimationDidStopSelector' part in the core animation code?
|
I would only use the
clause for infinite callbacks like yours. You're "setAnimationDidStopSelector" only calls another animation which then calls the previous one. So this looping will continue to occur forever, even if that screen is not technically visible.
EXAMPLE of not technically visible:
Code:
myScreen.hidden = true
The animation block is not being called infinitely, but the loop it makes between the second block is. So, animBlock A >> animBlock B >> animBlock A >> animBlock B >> etc. >> etc.
It will only stop for two reasons:
A) You remove the view controller that is handling these methods from the stack. IE. popScreen(). (I don't remember the exact syntax for that call.) or
B) you tell it to stop explicitly, by having one of the blocks NOT call the next, which you are not doing.
I just want to point out though, that this isn't really very processor heavy stuff, so even if you had to run this code constantly through you're app, I'm sure it'd be fine. I just wanted to point it out as a future reference.
Just from my programming habits, I've learned to NEVER code infinite loops. However, this is just my programming habits. So, it's just personal preference and really has no effect on output, I suppose.
Hope it's been helpful.