0

I got this error:

too many update animations on one view - limit is 31 in flight at a time

When executing [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];

Now I'm trying to limit the number of that method being called.

The question is, how can I know what is the limit count for the update animations count? In the above error, the limit is 31.

Should I hardcode the value?

EDIT:

[cell.imageView setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@", [[tempDictionary objectForKey:@"image"] objectForKey:@"url"]]] placeholderImage:placeholderImage options:SDWebImageRetryFailed completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) {
    if (!image)
        [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
}];

basically the code above requests for an image to be set to an UIImageView. If the request failed (no image received), it tells the UITableView to reload the cell, thus requesting the image once more.

Oscar Yuandinata
  • 1,025
  • 1
  • 13
  • 31
  • I think you missunderstoon how to use reaload function. Can you paste code where you call this function? – Szu Jun 06 '14 at 09:17
  • @OscarYuandinata, have you resolved this issue? I just found the same error in UICollectionView. – Itachi Sep 18 '14 at 11:34
  • @Itachi, I used this code in cellForRow function. I resolve this problem by not calling it as setImageWithURL will get called everytime the cell comes into view – Oscar Yuandinata Sep 22 '14 at 07:06
  • @OscarYuandinata then is that related with web request? What if all the images is loaded from local bundle, how did you update/set the image for cell finally? – Itachi Sep 23 '14 at 08:03

0 Answers0