What is the difference between [self removeChild:<node> cleanup:YES]; and [self removeChild:<node> cleanup:NO];
When the node execute dealloc the scheduledSelectors methods are released.
And the actions cant run if the his target is released.
what is the utility of "cleanup"?
(4 posts) (4 voices)-
Posted 2 years ago #
-
cleanup:NO will not call a dealloc on the node, while cleanup:YES will call a dealloc on your node and eventually release it from memory.
I think that when a node gets a dealloc call, all of his actions are deleted and all schedules get unscheduled.Hope I got your question and helped you a bit.
~ Natanavra.Posted 2 years ago # -
"cleanup:NO will not call a dealloc on the node"
I think your node will get release'd either way. If you havent retain'ed it somewhere else it should be dealloc'ed either way.
cleanup:YES will stop all its timers and release all its scheduled selectors (and do the same for any of its children).
I think you would use cleanup:NO if you want to take a node that still has running actions out of its parent, and then insert as the child of a different node while still keeping all of its actions running. Otherwise its cleanup:YES.
Posted 2 years ago # -
I like when you talk smart :)
Posted 2 years ago #
Reply
You must log in to post.