1.UI control comes with recycling
Uitableview,uicollectionview, itself with recycling, find cells in the cache pool through identifiers
Note: When you pass model data to the cell, you need to cover it all, if it's just a cell. Text1 = DataText1, then the image and Text2 of the newly displayed cell will display the old data
2. Recycling on the Uiscrollview
Ideas:
A. Get the number of data to be displayed count1, get the number of controls currently initialized Count2 (assuming UIView, and need to have 1 numbers assembled UIView, the array with lazy loading method, Count2 is actually the number of array elements)
B. Set a null pointer to the control: UIView *a = Nil
C. Traversing Count1
if (I <= count2) assigns a value directly to the control
else i > Count2, instantiate a new control, assign a value to the new control, and add the new control to the array
D. Overwrite data and handle data redundancy
E. For controls that have already been instantiated, whether they are recycled or hidden during the recycling process
Depending on the frequency of instantiation, if the frequency of instantiation is very high, it is recommended to use hidden; If the frequency is not high, the recovery
Considerations for IOS Recycling