views:

39

answers:

1

Below is the relevant code

.h

IBOutlet UIImageView *productImageView;
@property(nonatomic, retain) IBOutlet UIImageView *productImageView;

.m

@synthesize productImageView

in the initWithNibName custom initialization:

NSURL *url = [NSURL URLWithString: [NSString stringWithFormat:@"http://www.myurl.net/test.jpg"]];
UIImage *image = [UIImage imageWithData: [NSData dataWithContentsOfURL:url]];
productImageView.image = image;
A: 
  1. Don't forget the semicolon after the @synthesize directive.
  2. Have you connected the IBOutlet to your controller in Interface Builder?
  3. You have a memory leak: an UIImageView retains its image, so you need to release the one you allocate in your method.
L Cassarani