Analysis of timing problems in cocos2dx

Source: Internet
Author: User

Analysis of timing problems in cocos2dx
Today, we have encountered a problem. For UIListView, if you operate it immediately after the initialization (pushBackCustomItem), it may cause some strange problems because the original is not re-deployed. After checking the code, we found that doLayout and forceDoLayout can be re-deployed, and the caller is the visit function. Therefore, after the ListView is initialized, use visit immediately and then perform the listView operation. However, you must note that visit is also called during OnEnter, that is, visit is actually more than once. If the results of the first visit and the second visit are the same, that is, the results are correct, then there is no problem. Otherwise, the result is incorrect after manual visit. Therefore, manual visit call is useless. Another problem is that after visit, if you perform synchronization operations, there is no problem. If the latency operation is performed and the items of ListView is changed before the delay ends, the DoLayout operation will be performed again. Some parameters will change, and the subsequent delay operation will deviate from the original setting, an error occurred. If visit is unavailable, a callback must be provided after the notification is fully loaded (that is, visit). The notification can be followed by the next step, otherwise, it is impossible to make some operations such as the sequence after loading and re-computing is complete. There is no such callback, so you can only use visit.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.