I am trying to load a UIImage
from its URL with completion
and placeholder
image , but neither the UIImage
nor the placeholder UIImage
are loaded.
Here is my code:
NSURL *url = [NSURL URLWithString:@"http://assets.gearlive.com/tvenvy/blogimages/stewiegriffin.jpg"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[self.imageView setImageWithURLRequest:request placeholderImage:[UIImage imageNamed:@"bg.png"]
success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
imageView.image = image;
}
failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error) {}
];
self.imageView.image = [UIImage imageNamed:@"bg.png"];
to make sure your image view is visible and setting the image works.. – Duesterself.imageView.backgroundColor = [UIColor redColor];
and run the app to make sure the image view is acually visible on the screen.. – Duester