In iOS5 this works fine:
[descriptionWebView.scrollView setScrollEnabled:NO];
But in any iOS under 5 it fails with:
[UIWebView scrollView]: unrecognized selector sent to instance 0x791f9e0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIWebView scrollView]: unrecognized selector sent to instance 0x791f9e0'
The issue isn’t the
setScrollEnabled:call. It’s actually that thescrollViewof theUIWebViewwasn’t exposed until iOS 5 (which is why it fails on anything else). See theUIWebViewdocumentation for further information.In previous versions of iOS, you had to resort to iterating through the subviews of your
UIWebViewto find aUIScrollView.