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