In the past few days, I have been trying to solve the puzzle why my NSFetchedResultsController with a lot size of 20 will always be erroneous (i.e. load into memory) all my objects immediately after the selection is completed, as a result of which the request will take ~ 20 seconds.
It turns out that this is because in my heightForRowAtIndexPath, the height was based on the length of the NSString property of each selected object, and therefore when reloading the table, if the table has 2000 rows, then the height is calculated for each row at the beginning, and since I get access to the text property of the object, he will be mistaken in 2000 objects (in 20 lots of sizes) at the very beginning, forcing him to accept forever. (I did not know that the line heights were calculated all at the beginning).
So, the question is that if I have a sampling result controller with a batch size of 20, but my line heights are based on the text property of the object, which, if I try to access it, will cause the object not to be an error, but actually loaded into memory, what will be the workaround for calculating the height?
What are my options?
source share