I am using the following code to display an image in my ImageView:
imgbackBG.image = [UIImage imageWithData:
[NSData dataWithContentsOfURL:
[NSURL URLWithString:[NSString stringWithFormat:@"http://%@", [test.arrImagessplash objectAtIndex:[test.arrImages count]-4]]]]];
4cing.com/mobile_app/uploads/pageicon/splash.png
The problem is that the code executes very slowly. Is there a way to load the image and display it in the ImageView more quickly? If so, how can I do this?
Use SdwebImage framework for Image Cache
https://github.com/rs/SDWebImage
The code you are using loading image on main thread. This will block the UI. use GCD async for loading images.
Here is the sample code:
Download the Files from here.....
https://github.com/nicklockwood/AsyncImageView
and use as the following way: