So this is my problem: I have an UITableView with custom UITableViewCells. Each one of the cells have one UIImageView which downloads an remote image using asynchronous image loading.
It's working ALMOST perfectly, but I have this weird issue.
When the view is loaded I can see the 5 or 6 first cells without scrolling (iPhone's display height).
The problem is: the image of each cell doesn't appear at this moment. Scrolling the table to the bottom, the cells #7~end loads perfectly.
The WEIRD fact is: when I scroll back to the top, now the 5 or 6 cells loads perfectly.
My first thought was: when the view is loaded, the cellForRowAtIndexPath method was not calling loadimage method automatically for the first cells, just after user interaction.
But using NSLog (step by step) to find where is the problem, the thing is:
- cellForRowAtIndexPath calls the loadimage method
- inside loadimage method, the NSURLConnection is created
- NSURLConnection didReceiveData's method is not being called
So, the loadimage method is being called, indeed. But not receiving data.
Scrolling to the bottom and then going back to the top cells, it's all ok. The word is WEIRD.