AFNetworking/AFNetworking — pull request #1184 by autresphere (2013-07-31 09:32:16+00:00)
Title: Allow nested call to setImageWithURLRequest

Calling [UIImageView setImageWithURL:] inside [UIImageView setImageWithURLRequest:placeholderImage:success:failure] completion block could NOT work.
This was due to internal af_imageRequestOperation set to nil AFTER a completion block is called. With this fix, it is now set to nil BEFORE.

This fix is useful if you load your image in two steps. Like in the following sample, the first step quickly loads a low def image, the second step loads a high def image.

[imageView setImageWithURLRequest:smallImageRequest
placeholderImage:placeHolderImage
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
[imageView setImageWithURL:largeImageURL];
}
failure:nil];