I'm looking for a reasonably technical explanation of how scheduling (and more specifically) unscheduling works in coocs2d. The reason I'm asking is in my program I have some sprites appear on the screen, at which point I have them schedule themselves to die in 5 seconds. However, if you touch them they are "saved" and I call "unschedule" on them, to stop their death method.
[self schedule: @selector(dotSuicide:) interval:theLifeSpan]; //This causes it to die
[self schedule: @selector(fadeOut:) interval:(theLifeSpan - kdotFadeTime)]; //This causes it to fade out
And then:
[theSprite unschedule:@selector(fadeOut:)];
[theSprite unschedule:@selector(dotSuicide:)];
However, the unscheduling doesn't seem to be working properly, or not *all the time*, and so I'm trying to get a little deeper into this issue to figure out what's happening.
Thanks!