user1278459
user1278459

Reputation: 43

How to display images from url asynchronously in scrollview?

Hi i'm new to iPhone application.In my application i used tableview. when i click table cell it does to detail view which has tab bar controller.i have 3 tabbaritems. one to display description, another one to display 5 images in scrollview and third one to display location. when i click table cell it takes more time to load all images. please i need help to complete my application.Many people said to do asynchronously but i don't know how to do. thanks in advance. waiting for a solution

Upvotes: 1

Views: 1031

Answers (2)

Minakshi
Minakshi

Reputation: 1433

Load the images in function loadImage and call it in background as follows...So your view will appear and images will be loaded in background

     [self performSelectorInBackground:@selector(loadImag) withObject:nil];

Upvotes: 0

HyLian
HyLian

Reputation: 5093

You can use GCD to load those images asynchronously

I don't know how is the layout of your viewcontrollers but you should put in the viewDidLoad of your ViewController which displays the images something like this.

dispatch_queue_t queue = 
              dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(queue, ^{
  theImageView.image = // Whatever your method to grab the image will be
});

Upvotes: 2

Related Questions