I'm using the AFNetworking API and I'm using the AFImageRequestOperation function to call a Image URL from a server API to convert that into a UIImage. What I want to do is; every time I call this method:
NSURLRequest *requestImage = [NSURLRequest requestWithURL:theImageURL];
// theImageURL is the Image URL that is collected in a previous method from the server.
AFImageRequestOperation *imageOperation = [AFImageRequestOperation imageRequestOperationWithRequest:requestImage imageProcessingBlock:nil success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image)
{
objImageArray = [[NSMutableArray alloc] init];
if (requestImage != nil) {
[objImageArray addObjectsFromArray:image];
}
} failure:nil];
[imageOperation start];
So I have called the URL and successfully assigned the image URL to the UIImage. I've then allocated a NSMutableArray and added the image to it. The problem I'm having is that every time the method is called again the MutableArray replaces the old Image with the new one. I Thanks In advance!