Im new in iOS programming so i need some help. I have a TableViewController with a property NSArray, where is stored Facebook User's friends info: uid, square_pic and name. I use to load their profile photos using FBProfilePictureView, by uid. My problem: When user scroll the table pictures from cells take a lot of time to reload. I want to cache this photos using SDWebImage. Thank's a lot.
Asked
Active
Viewed 394 times
1 Answers
0
I am not familiar to SDWebImage. Their readme mentions ability to cache, so you might want to figure it out on your own.
However, there is a really nice class called NSCache that you can implement in some of your managers or view controllers. Also, this post by Mattt Thompson covers it in great details. It functions as a regular NSDictionary in sense that you can set object for keys and retrieve them. e.g:
//setting
[cache setObject:image forKey:@"yourImageURL"]
//accessing
UIImage *image = [cache objectForKey:@"yourImageURL"];
if (image == nil) {
// request it
}
But it also contains some awesome staff for setting values for objects which will serve as a hint which objects have to be removed in case of low memory.
Hope this helps to answer your question. Cheers!

Arthur Shinkevich
- 801
- 5
- 12