title: Loading image in image view from a URL, using the iPhone sdk?
body: <p>I've gone through a lot of code from the web in an attempt to load an image view via URL. Unfortunately, none of the solutions I tried has worked for me and I get very strange errors. I am getting image data, but no image from this NSData. I used the below code with a sample URL and it works, giving me the represented image. However when I switch it to use my actual URL I run into problems because it seems like it is attempting to create/return an image which is too large in size. Here is my code:</p>
  
  <pre><code>    NSString *urlString = [[[_xmlDictionary objectForKey:@"response"] objectForKey:@"movie"] objectForKey:@"poster"];   
  
      NSArray *parts = [urlString componentsSeparatedByString:@"\""];
      urlString = [parts objectAtIndex:1];
  
      urlString = [urlString stringByAppendingFormat:@"/"];
      urlString = [urlString  
          stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
  
      //NSURL * imageURL = [NSURL URLWithString:urlString];
      NSLog(@"URL:%@",urlString);
      NSURL * imageURL = [NSURL URLWithString:urlString];
      NSData * imageData = [[NSData alloc] initWithContentsOfURL:imageURL];
      UIImage * image = [[UIImage alloc] initWithData:imageData];
      m_imageView = [[UIImageView alloc] initWithImage:image];
      m_imageView.frame = CGRectMake(10, 10,300,300);
      [self.view addSubview:m_imageView];
      [imageData release];
      [image release];
  </code></pre>
  
  <p>I'd appreciate any help, thanks in advance.</p>