Regardless of which method is used: iOS 5 [NSURLConnection sendAsynchronousRequest] , SDWebImage or ASIHTTPRequest , that if, while the image is loading, the aleady cell has been deleted (when dequeueReusableCellWithIdentifier is dequeueReusableCellWithIdentifier ), and therefore, the new shortcut can now be marked as “Mary” while the Peters image is loading, and when the download is complete, the image of Peter is populated in the Marys field.
It would be better if Mary’s image is also uploaded later and goes to Mary’s cell and covers Peter’s photo, but what if
1) Does Mary’s photo take 1 or 2 seconds to download (slow or cellular phone network delay), or is the network just choking at this point? Then the photo of Peter will be displayed next to the name Mary for 1 or 2 seconds or 20 seconds, or even forever, if the network request just failed this time.
2) It will be worse if Mary’s data has a privacy setting of "Do not show my photo" or something else, then cellForRowAtIndexPath can actually set the dummy image (dummy avatar) in Mary imageView and when the image of Peter loads, go to Mary’s cell and never replace.
Could this be elegantly crafted or resolved?
By the way, if we use SDWebImage or ASIHTTPRequest , will the problem be there or will the class handle it already?
source share