You can also use an index-based removal. The drawback of this solution is that the list1.size() gets evaluated during every loop iteration. The positive thing is that removing an item from a List by its index is faster.

for (int i = 0; i &lt; list1.size(); /* i incremented in loop body */) {
  if ("World".equals(list1.get(i))) {
    list1.remove(i);
  }
  else {
    i++;
  }
}


How remove works for ArrayList while iterating using for-each loop?
After adding SDWebImage lib and putting their standard code:


  [cell.imageView setImageWithURL:[NSURL
  URLWithString:@"http://www.domain.com/path/to/image.jpg"]
                     placeholderImage:[UIImage imageNamed:@"placeholder.png"]];


I get the next error:


  ViewController.m: error: Automatic Reference Counting Issue: Receiver type 'UIImageView' for instance message does not declare a method with selector 'setImageWithURL:placeholderImage:'


How can I solve it?
