Asynchronously setting avatar image
Hello,
I have a Parse User class and a column of that class is "ProfilePicture" that holds PFFile's for each user's profile picture. What would be the best way to asynchronously set avatar images inside "avatarImageDataForItemAtIndexPath"??
Thanks
set it to the avatarImageView inside cellForItemAtIndexPath
Thanks @ssuchanowski
I keep getting "unexpectedly found nil while unwrapping an optional value". Do I need to register a nib for my view controller and if so, which one?
Screenshot:

@ssuchanowski @jessesquires I was able to accomplish my goal. However, now after sending a message, the collectionview refreshes itself, and thus, refreshes the UIImageView holding the profile picture as well.This makes the page look very glitchy. Is there any way to not have the uiimage view be refreshed?
Figured it out
A gentle suggestion: on a board dedicated to sharing, helping out, offering code etc, to come asking for advice and to not properly conclude a self-corrected thread with a solution, or a link or even a hint is considered, at least in my office, poor etiquette..
@wdcurry the original question that was posted was answered. Apologies! :)
If anyone gets stuck with this.. The solution was to remove setting the avatar in 'CellForRowAtIndexPath' altogether. The much better method is using 'avatarImageData' . JSQmesages will properly store the images so the need for them to be refreshed is eliminated. Originally, i opted not to use this method because I needed to modify the avatarImageView but I found a workaround for my situation.
@dailenspencer could you elaborate your solution please.
@dailenspencer How exactly did you load the image asynchronously in the avatarImageDataForItemAt method? Since that method is synchronous, I'm having trouble figuring out how to tie it all together. Any example code would be nice.
@Baam25 @Isuru-Nanayakkara Apologies mates, I no longer have access to the code base I was working on at the time. All I can recall is that, originally, I was attempting to load and set the avatar inside cellForRowAtIndexPath - but then realized the more appropriate solution was to set the image using avatarImageData. I know thats just a reiteration of my previous answer :/