I am following Paul Hegarty's 2012-2013 course in iTunes-u. In lesson 9 he gets the course to create a minimal app to display a photo on a UIScrollView. For him it worked first time. I thought I had copied the exercise exactly, but it has never scrolled for me.
The guts of code are this:
-(void)resetImage
{
if (self.scrollView) {
self.scrollView.contentSize = CGSizeZero;
self.imageView = nil;
UIImage *image = [UIImage imageNamed:@"photo_3.jpg"];
if (image) {
self.scrollView.contentSize = image.size;
self.imageView.image = image;
self.imageView.frame = CGRectMake(0, 0, image.size.width, image.size.height);
}
}
}
The image comes up and is fine in the simulator, but attempting to scroll has no effect. Can anyone suggest why scrolling doesn't work?
TIA Mark