adding UIImageView to UIScrollView throws exception cocoa touch for iPad <p>I am a noob at OBJ-C :)</p> <p>I am trying to add a UIImageView to a UIScrollView to display a large image in my iPhone app. </p> <p>I have followed the tutorial here exactly: </p> <p><a href="http://howtomakeiphoneapps.com/2009/12/how-to-use-uiscrollview-in-your-iphone-app/" rel="nofollow noreferrer">http://howtomakeiphoneapps.com/2009/12/how-to-use-uiscrollview-in-your-iphone-app/</a></p> <p>The only difference is that in my App the View is in a seperate tab and I am using a different image.</p> <p>here is my code:</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; UIImageView *tempImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Cheyenne81"]]; self.imageView = tempImageView; [tempImageView release]; scrollView.contentSize = CGSizeMake(imageView.frame.size.width, imageView.frame.size.height); scrollView.maximumZoomScale = 4.0; scrollView.minimumZoomScale = 0.75; scrollView.clipsToBounds = YES; scrollView.delegate = self; [scrollView addSubview:imageView]; } - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{ return imageView; } </code></pre> <p>and:</p> <pre><code>@interface UseScrollViewViewController : UIViewController&lt;UIScrollViewDelegate&gt;{ IBOutlet UIScrollView *scrollView; UIImageView *imageView; } @property (nonatomic, retain) UIScrollView *scrollView; @property (nonatomic, retain) UIImageView *imageView; @end </code></pre> <p>I then create a UIScrollView in Interface Builder and link it to the scrollView outlet. Thats when I get the problem. When I run the program it crashes instantly. If I run it without linking the scrollView to the outlet, it will run (allbeit with a blnk screen).</p> <p>The following is the error I get in the console:</p> <blockquote> <p>2010-03-27 20:18:13.467 UseScrollViewViewController[7421:207] <code>*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[&lt;UIViewController 0x4a179b0&gt; setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key scrollView.'</code></p> </blockquote>