title: How to reload my view in iOS
body: <p>I have a imageView embedded in a scrollView. The imageView needs to be downloaded from the Internet (through flickr api), so I add a thread to handle this. But what am I supposed to do after I finished downloading the image? How can I reload my imageView?Here's my code.</p>
  
  <p>In fact, it is working fine. but the imageView's size is (0, 0). How can I fix that?</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
      if (!self.myImage)
      {
          UIActivityIndicatorView* spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
          [spinner startAnimating];
          self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:spinner];
          dispatch_queue_t downloadQueue = dispatch_queue_create("flickr downloader (photo)", NULL);
          dispatch_async(downloadQueue, ^{
              NSData* data = [NSData dataWithContentsOfURL:[FlickrFetcher urlForPhoto:self.photo format:FlickrPhotoFormatLarge]];
              dispatch_async(dispatch_get_main_queue(), ^{
                  self.myImage = [UIImage imageWithData:data];
                  [self.imageView setImage:self.myImage];
                  [self viewDidLoad];
                  [self viewWillAppear:NO];
                  NSLog(@"imageViewSet!");
                  self.navigationItem.rightBarButtonItem = nil;
              });
          });    
          dispatch_release(downloadQueue);
      }
      else
      {
          NSString* imageTitle;
          if ([[self.photo objectForKey:@"title"] length] &gt; 0)
              imageTitle = [self.photo objectForKey:@"title"];
          else if ([[self.photo valueForKeyPath:@"description._content"] length] &gt; 0)
              imageTitle = [self.photo valueForKeyPath:@"description._content"];
          else imageTitle = @"Unknown";
          [[self navigationItem] setTitle:imageTitle];
          self.scrollView.delegate = self;
          self.scrollView.contentSize = self.imageView.image.size;
      }
  }
  
  - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
  {
      return self.imageView;
  }
  
  - (void)viewWillAppear:(BOOL)animated
  {
  
      [super viewWillAppear:animated];
      double scale = self.imageView.bounds.size.width * 1.0 / self.myImage.size.width;
      if (scale &gt; self.imageView.bounds.size.height * 1.0 / self.myImage.size.height)
          scale = self.imageView.bounds.size.height * 1.0 / self.myImage.size.height;
      NSLog(@"imgview%g, %g",self.imageView.bounds.size.width, self.imageView.bounds.size.height);
      NSLog(@"img%g, %g",self.myImage.size.width, self.myImage.size.height);
      self.imageView.frame = CGRectMake(0, 0, self.imageView.image.size.width, self.imageView.image.size.height);
      [self.scrollView setZoomScale:scale];
  }
  </code></pre>