Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lag when reusing UITableViewCells with FBProfilePictureView

I have an app where I display posts from a user's news feed in a UITableView. I use a FBProfilePictureView to display the profile picture of the person who made the post. It works just fine for pulling down and displaying the profile pic, except when scrolling. There is a very noticeable lag when scrolling before the pictureview displays the picture of the new user, where the view is showing the picture from the recycled cell.

like image 486
s73v3r Avatar asked Sep 12 '12 17:09

s73v3r


1 Answers

If you set the profileID to nil before setting it to the new profileID string, the FBProfilePictureView will display the default Facebook profile picture while it fetches the intended one. This way, you at least won't still be displaying the image from the previous cell.

Note that setting the profileID to the empty string @"" will NOT have this same effect of displaying the default Facebook profile picture.

EDIT: I just updated to FB SDK 3.7 and the default profile picture is no longer shown as described above. Instead, when nil is given, it does not show any image at all.

like image 109
Julian Avatar answered Nov 05 '22 11:11

Julian