Oopa,I have found a solution to my own problem
Simply ignore saving the images to documents folder,that will increase our sync speed.
Later while displaying the details with images,simply retrieve the friend image using graph api,i.e. with one single line:
NSString *profilePicURL = [NSString stringWithFormat:@"http://graph.facebook.com/%@/picture",friendID];
and we can do the fetching stuff in background using GCD model for asynchronous loading,which will not let the performance slow down.
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
dispatch_async(queue, ^{
NSString *profilePicURL = [NSString stringWithFormat:@"http://graph.facebook.com/%@/picture",friendID];
NSURL *profilePhotoURL = [NSURL URLWithString:profilePicURL];
NSData *photoData = [NSData dataWithContentsOfURL:profilePhotoURL];
dispatch_sync(dispatch_get_main_queue(), ^{
//assign the image to cell here
image = [UIImage imageWithData:photoData];
cell.imageView = image;
});
});
Thanks,hope this helps some one :)