Chat list cannot load data successfully at Reloaddata

Source: Internet
Author: User

During the development of the project, you encounter a problem where the chat list on IPhone6 cannot load data successfully at Reloaddata, but it can be loaded successfully as long as the finger slips uitableview.

At the beginning of the problem to be confused, always do not understand what is the problem, after the online search for information to find out where the problem and solve the problem. The problem analysis and solutions are now posted:

1, the UI can not be updated in the sub-thread, if the appearance of a successful update is an illusion. Because in a child thread, the code executes automatically into the main thread and executes the UI-updated function in the child thread, the process is very fast, causing everyone to mistakenly assume that the child thread can update the UI. If the child thread is running, the main thread cannot update the UI by knowing that the function stack of the UI is updated in the child thread.

2. In some cases, the UI can be updated in a sub-thread, because the current environment can be obtained when a thread is tapped, such as clicking a button response, essentially opening up a sub-thread that can update the UI of the button in time (for example, title, background, etc.).

In summary, updates to the UI are performed in the main thread.

Chat list cannot load data successfully at Reloaddata

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.