I was told that if relying on a specific ordering of objects, I should not use the fastRemoveObject methods in CCArray. Cocos2d API references don't show the contents of the method specifically. Can anyone tell me the reason?
Yes, fastRemoveObject changes the order of nodes. It is therefore not recommended unless it really doesn't matter in your case.
What it does is the following:
That way the array will not have to perform memory operations (hence: fast). But the last object will now be at the index of the removed object.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.